# Maple integration test file: "1 Algebraic functions\1.2 Trinomial products\1.2.1 Quadratic\1.2.1.9 P(x) (d+e x)^m (a+b x+c x^2)^p.txt"

lst:=[

# Integrands of the form P2[x] (d+e x)^m (a+b x+c x^2)^p

# Integrands of the form P2[x] (d+e x)^m (a+b x+c x^2)^p when b=0 and c d^2+a e^2=0

# Integrands of the form P2[x] (d+e x)^m (d^2-e^2 x^2)^p

# p>0
[(d+e*x)^2*(A+B*x+C*x^2)*sqrt(d^2-e^2*x^2),x,7,-1/15*d*(4*C*d^2+e*(7*B*d+10*A*e))*(d^2-e^2*x^2)^(3/2)/e^3-1/8*(3*C*d^2+2*e*(2*B*d+A*e))*x*(d^2-e^2*x^2)^(3/2)/e^2-1/5*(2*C*d+B*e)*x^2*(d^2-e^2*x^2)^(3/2)/e-1/6*C*x^3*(d^2-e^2*x^2)^(3/2)+1/16*d^4*(3*C*d^2+4*B*d*e+10*A*e^2)*arctan(e*x/sqrt(d^2-e^2*x^2))/e^3+1/16*d^2*(3*C*d^2+4*B*d*e+10*A*e^2)*x*sqrt(d^2-e^2*x^2)/e^2],
[(d+e*x)*(A+B*x+C*x^2)*sqrt(d^2-e^2*x^2),x,6,-1/15*(2*C*d^2+5*e*(B*d+A*e))*(d^2-e^2*x^2)^(3/2)/e^3-1/4*(C*d+B*e)*x*(d^2-e^2*x^2)^(3/2)/e^2-1/5*C*x^2*(d^2-e^2*x^2)^(3/2)/e+1/8*d^3*(C*d^2+e*(B*d+4*A*e))*arctan(e*x/sqrt(d^2-e^2*x^2))/e^3+1/8*d*(C*d^2+e*(B*d+4*A*e))*x*sqrt(d^2-e^2*x^2)/e^2],
[(A+B*x+C*x^2)*sqrt(d^2-e^2*x^2),x,5,-1/3*B*(d^2-e^2*x^2)^(3/2)/e^2-1/4*C*x*(d^2-e^2*x^2)^(3/2)/e^2+1/8*d^2*(C*d^2+4*A*e^2)*arctan(e*x/sqrt(d^2-e^2*x^2))/e^3+1/8*(4*A+C*d^2/e^2)*x*sq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*sqrt(2+3*x^2)))/sqrt(11)+1/66*(-38+21*x)/sqrt(2+3*x^2)],
[(1+3*x+4*x^2)/((1+2*x)^2*(2+3*x^2)^(3/2)),x,4,4/121*arctanh((4-3*x)/(sqrt(11)*sqrt(2+3*x^2)))/sqrt(11)+1/242*(-10+97*x)/sqrt(2+3*x^2)-4/121*sqrt(2+3*x^2)/(1+2*x)],
[(1+3*x+4*x^2)/((1+2*x)^3*(2+3*x^2)^(3/2)),x,5,-322/1331*arctanh((4-3*x)/(sqrt(11)*sqrt(2+3*x^2)))/sqrt(11)+1/2662*(358+351*x)/sqrt(2+3*x^2)-2/121*sqrt(2+3*x^2)/(1+2*x)^2+2/1331*sqrt(2+3*x^2)/(1+2*x)],
[(1+2*x)^3*(1+3*x+4*x^2)/(2+3*x^2)^(5/2),x,4,1/162*(398+279*x)/(2+3*x^2)^(3/2)+8*arcsinh(x*sqrt(3/2))/sqrt(3)+1/54*(-152-465*x)/sqrt(2+3*x^2)+32/27*sqrt(2+3*x^2)],
[(1+2*x)^2*(1+3*x+4*x^2)/(2+3*x^2)^(5/2),x,4,1/54*(70-47*x)/(2+3*x^2)^(3/2)+16/9*arcsinh(x*sqrt(3/2))/sqrt(3)+1/54*(-168-59*x)/sqrt(2+3*x^2)],
[(1+2*x)*(1+3*x+4*x^2)/(2+3*x^2)^(5/2),x,2,1/54*(2-51*x)/(2+3*x^2)^(3/2)+1/18*(-16+13*x)/sqrt(2+3*x^2)],
[(1+3*x+4*x^2)/((1+2*x)*(2+3*x^2)^(5/2)),x,5,1/198*(-38+21*x)/(2+3*x^2)^(3/2)-8/121*arctanh((4-3*x)/(sqrt(11)*sqrt(2+3*x^2)))/sqrt(11)+1/726*(24+95*x)/sqrt(2+3*x^2)],
[(1+3*x+4*x^2)/((1+2*x)^2*(2+3*x^2)^(5/2)),x,5,1/726*(-10+97*x)/(2+3*x^2)^(3/2)-32/1331*arctanh((4-3*x)/(sqrt(11)*sqrt(2+3*x^2)))/sqrt(11)+1/7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t(c))/((-h*sqrt(-a)+g*sqrt(c))*(sqrt(-a)-x*sqrt(c))))^p)],

# Integrands of the form P2[x] (d+e x)^m (a+b x+c x^2)^p when b^2-4 a c=0

# Integrands of the form P2[x] (d+e x)^m (a+b x+c x^2)^p when c d^2-b d e+a e^2=0

# Integrands of the form (d+e x)^m (A+B x+C x^2) (c d^2-b d e-b e^2 x-c e^2 x^2)^p

# Integrands of the form (d+e x)^(m/2) (A+B x+C x^2) (c d^2-b d e-b e^2 x-c e^2 x^2)^(p/2)

# Integrands of the form (d+e x)^m (A+B x+C x^2) (c d^2-b d e-b e^2 x-c e^2 x^2)^p when p symbolic
[(d+e*x)^m*(-c*d^2+b*d*e+b*e^2*x+c*e^2*x^2)^p*(-(c*d-b*e)*f+(c*e*f-c*d*g+b*e*g)*x+c*e*g*x^2),x,6,g*(d+e*x)^(-1+m)*(-d*(c*d-b*e)+b*e^2*x+c*e^2*x^2)^(2+p)/(c*e^2*(3+m+2*p))-(b*e*g*(1+m+p)+c*(d*g*(1-m)-e*f*(3+m+2*p)))*(d+e*x)^m*(c*(d+e*x)/(2*c*d-b*e))^(-m-p)*(c*d-b*e-c*e*x)^2*(-d*(c*d-b*e)+b*e^2*x+c*e^2*x^2)^p*hypergeom([-m-p,2+p],[3+p],(c*d-b*e-c*e*x)/(2*c*d-b*e))/(c^2*e^2*(2+p)*(3+m+2*p))],

# Integrands of the form P2[x] (d+e x)^m (a+b x+c x^2)^p

# Integrands of the form (A+B x+C x^2) (d+e x)^m (a+b x+c x^2)^p with B=0

# p>0
[(a+b*x+c*x^2)^4*(A+C*x^2),x,2,a^4*A*x+2*a^3*A*b*x^2+1/3*a^2*(6*A*b^2+4*a*A*c+a^2*C)*x^3+a*b*(A*(b^2+3*a*c)+a^2*C)*x^4+1/5*(A*(b^4+12*a*b^2*c+6*a^2*c^2)+2*a^2*(3*b^2+2*a*c)*C)*x^5+2/3*b*(b^2+3*a*c)*(A*c+a*C)*x^6+1/7*(2*A*c^2*(3*b^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3/2)))*((4*c^5*d^3*f + 3*b^5*e^3*h - 2*b^3*c*e^2*(b*e*g + 3*b*d*h + 10*a*e*h) - 2*c^4*d*(b*d*(3*e*f + d*g) - 2*a*(3*e^2*f + 3*d*e*g + d^2*h)) - 6*a*c^3*e*(2*a*e*(e*g + 3*d*h) + b*(e^2*f + 3*d*e*g + 3*d^2*h)) + b*c^2*e*(30*a^2*e^2*h + 12*a*b*e*(e*g + 3*d*h) + b^2*(e^2*f + 3*d*e*g + 3*d^2*h)))*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]]) + (e*(3*b^2*e^2*h + c^2*(e^2*f + 3*d*e*g + 3*d^2*h) - 2*c*e*(b*e*g + 3*b*d*h + a*e*h))*Log[a + b*x + c*x^2])/(2*c^4), (e^2*(6*c^3*d*f - 3*b^3*e*h - c^2*(b*e*f + 3*b*d*g + 6*a*e*g + 18*a*d*h) + b*c*(2*b*e*g + 6*b*d*h + 11*a*e*h))*x)/(c^3*(b^2 - 4*a*c)) + (e^3*(4*c^2*f + 3*b^2*h - 2*c*(b*g + 4*a*h))*x^2)/(2*c^2*(b^2 - 4*a*c)) + ((d + e*x)^3*(c*(2*a*g - b*(f + (a*h)/c)) - (2*c^2*f - b*c*g + b^2*h - 2*a*c*h)*x))/(c*(b^2 - 4*a*c)*(a + b*x + c*x^2)) + ((4*c^5*d^3*f + 3*b^5*e^3*h - 2*b^3*c*e^2*(b*e*g + 3*b*d*h + 10*a*e*h) - 2*c^4*d*(b*d*(3*e*f + d*g) - 2*a*(3*e^2*f + 3*d*e*g + d^2*h)) - 6*a*c^3*e*(2*a*e*(e*g + 3*d*h) + b*(e^2*f + 3*d*e*g + 3*d^2*h)) + b*c^2*e*(30*a^2*e^2*h + 12*a*b*e*(e*g + 3*d*h) + b^2*(e^2*f + 3*d*e*g + 3*d^2*h)))*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(c^4*(b^2 - 4*a*c)^(3/2)) + (e*(3*b^2*e^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*g+d^2*h))-6*c^2*e*(4*a*b*d*e^2*f-b^2*d^3*g+2*a^2*e*(e^2*f-2*d*e*g+2*d^2*h))-c*e*(6*a^2*b*e^3*g-4*a^3*e^3*h-b^3*d*(4*e^2*f-3*d*e*g-2*d^2*h)-6*a*b^2*e*(2*e^2*f-d*e*g+2*d^2*h)))*arctanh((b+2*c*x)/sqrt(b^2-4*a*c))/((b^2-4*a*c)^(3/2)*(c*d^2-b*d*e+a*e^2)^3)-e*(e^2*(2*b*e*f-b*d*g-a*e*g+2*a*d*h)-c*d*(4*e^2*f-3*d*e*g+2*d^2*h))*log(d+e*x)/(c*d^2-b*d*e+a*e^2)^3+1/2*e*(e^2*(2*b*e*f-b*d*g-a*e*g+2*a*d*h)-c*d*(4*e^2*f-3*d*e*g+2*d^2*h))*log(a+b*x+c*x^2)/(c*d^2-b*d*e+a*e^2)^3],

#  {(f + g*x + h*x^2)/((d + e*x)^3*(a + b*x + c*x^2)^2), x, 8, -((e*(e^2*f - d*e*g + d^2*h))/(2*(c*d^2 - b*d*e + a*e^2)^2*(d + e*x)^2)) + (e*(e^2*(2*b*e*f - b*d*g - a*e*g + 2*a*d*h) - c*d*(4*e^2*f - 3*d*e*g + 2*d^2*h)))/((c*d^2 - b*d*e + a*e^2)^3*(d + e*x)) + (1/((b^2 - 4*a*c)*(c*d^2 - b*d*e + a*e^2)^3*(a + b*x + c*x^2)))*(b^4*e^3*f - b^3*e^2*(3*c*d*f + a*e*g) + b^2*e*(3*c^2*d^2*f - a*c*e*(4*e*f - 3*d*g) + a^2*e^2*h) - b*c*(c^2*d^3*f - 3*a^2*e^2*(e*g - d*h) - a*c*d*(9*e^2*f - 3*d*e*g - d^2*h)) - 2*a*c*(c^2*d^2*(3*e*f - d*g) + a^2*e^3*h - a*c*e*(e^2*f - 3*d*e*g + 3*d^2*h)) - c*(2*c^3*d^3*f - b*e^3*(b^2*f - a*b*g + a^2*h) - c^2*d*(b*d*(3*e*f + d*g) + 2*a*(3*e^2*f - 3*d*e*g + d^2*h)) - c*(2*a^2*e^2*(e*g - 3*d*h) - 3*a*b*e*(e^2*f - d*e*g - d^2*h) - b^2*(3*d*e^2*f + d^3*h)))*x) + (1/((b^2 - 4*a*c)^(3/2)*(c*d^2 - b*d*e + a*e^2)^4))*((4*c^5*d^5*f + b^3*e^4*(b^2*(3*e*f - d*g) + a^2*e*h - 2*a*b*(e*g - d*h)) - 2*c^4*d^3*(b*d*(5*e*f + d*g) - 2*a*(10*e^2*f - 3*d*e*g + d^2*h)) - 2*b*c*e^3*(b^3*d*(5*e*f - 2*d*g) + 3*a^3*e^2*h - 6*a^2*b*e*(e*g - d*h) + 2*a*b^2*(5*e^2*f - 3*d*e*g + 2*d^2*h)) - c^2*e*(12*a^3*e^3*(e*g - 3*d*h) - b^3*d^2*(10*e^2*f - 6*d*e*g - 3*d^2*h) - 6*a^2*b*e^2*(5*e^2*f - 7*d*e*g + 2*d^2*h) - 12*a*b^2*d*e*(5*e^2*f - 2*d*e*g + 2*d^2*h)) + 2*c^3*d*e*(4*b^2*d^3*g - a*b*d*(30*e^2*f - 2*d*e*g - d^2*h) - 2*a^2*e*(15*e^2*f - 18*d*e*g + 14*d^2*h)))*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]]) + (e*(c^2*d^2*(10*e^2*f - 6*d*e*g + 3*d^2*h) + e^3*(b^2*(3*e*f - d*g) + a^2*e*h - 2*a*b*(e*g - d*h)) - 2*c*e^2*(b*d*(5*e*f - 2*d*g) + a*(e^2*f - 3*d*e*g + 4*d^2*h)))*Log[d + e*x])/(c*d^2 - b*d*e + a*e^2)^4 - (e*(c^2*d^2*(10*e^2*f - 6*d*e*g + 3*d^2*h) + e^3*(b^2*(3*e*f - d*g) + a^2*e*h - 2*a*b*(e*g - d*h)) - 2*c*e^2*(b*d*(5*e*f - 2*d*g) + a*(e^2*f - 3*d*e*g + 4*d^2*h)))*Log[a + b*x + c*x^2])/(2*(c*d^2 - b*d*e + a*e^2)^4)} 
[x^3*(1+x+x^2)/(1-x+x^2)^2,x,7,3*x+1/2*x^2+2/3*(2-x)/(1-x+x^2)+2*log(1-x+x^2)+10/3*arctan((1-2*x)/sqrt(3))/sqrt(3)],
[x^2*(1+x+x^2)/(1-x+x^2)^2,x,7,x+2/3*(1-2*x)/(1-x+x^2)+3/2*log(1-x+x^2)-7/3*arctan((1-2*x)/sqrt(3))/sqrt(3)],
[x*(1+x+x^2)/(1-x+x^2)^2,x,5,-2/3*(1+x)/(1-x+x^2)+1/2*log(1-x+x^2)-11/3*arctan((1-2*x)/sqrt(3))/sqrt(3)],
[(1+x+x^2)/(1-x+x^2)^2,x,4,-2/3*(2-x)/(1-x+x^2)-10/3*arctan((1-2*x)/sqrt(3))/sqrt(3)],
[(1+x+x^2)/(x*(1-x+x^2)^2),x,7,-2/3*(1-2*x)/(1-x+x^2)+log(x)-1/2*log(1-x+x^2)-11/3*arctan((1-2*x)/sqrt(3))/sqrt(3)],
[(1+x+x^2)/(x^2*(1-x+x^2)^2),x,7,(-1)/x+2/3*(1+x)/(1-x+x^2)+3*log(x)-3/2*log(1-x+x^2)-7/3*arctan((1-2*x)/sqrt(3))/sqrt(3)],
[(1+x+x^2)/(x^3*(1-x+x^2)^2),x,7,(-1/2)/x^2+(-3)/x+2/3*(2-x)/(1-x+x^2)+4*log(x)-2*log(1-x+x^2)+10/3*arctan((1-2*x)/sqrt(3))/sqrt(3)],
[(1-x^2)/(1+x+x^2)^2,x,1,x/(1+x+x^2)],
[(1+x^2)/(1+x+x^2),x,6,x-1/2*log(1+x+x^2)+arctan((1+2*x)/sqrt(3))/sqrt(3)],
[(-1+x^2)/(25-6*x+x^2),x,6,x-2*arctan(1/4*(-3+x))+3*log(25-6*x+x^2)],
[(-10+3*x^2)/(4-4*x+x^2),x,3,2/(2-x)+3*x+12*log(2-x)],
[(8+x^2)/(6-5*x+x^2),x,5,x-12*log(2-x)+17*log(3-x)],
[(-4+3*x+x^2)/(-8-2*x+x^2),x,5,x+4*log(4-x)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rt(2-x+3*x^2)/(1+2*x),x,7,2/9*(2-x+3*x^2)^(3/2)-43/144*arcsinh((1-6*x)/sqrt(23))/sqrt(3)-1/8*arctanh(1/2*(9-8*x)/(sqrt(13)*sqrt(2-x+3*x^2)))*sqrt(13)+1/72*(13+30*x)*sqrt(2-x+3*x^2)],
[(1+3*x+4*x^2)*sqrt(2-x+3*x^2)/(1+2*x)^2,x,7,-1/13*(2-x+3*x^2)^(3/2)/(1+2*x)-11/6*arcsinh((1-6*x)/sqrt(23))/sqrt(3)+17/8*arctanh(1/2*(9-8*x)/(sqrt(13)*sqrt(2-x+3*x^2)))/sqrt(13)-1/156*(67-96*x)*sqrt(2-x+3*x^2)],
[(1+3*x+4*x^2)*sqrt(2-x+3*x^2)/(1+2*x)^3,x,7,-1/26*(2-x+3*x^2)^(3/2)/(1+2*x)^2+11/8*arcsinh((1-6*x)/sqrt(23))/sqrt(3)-803/208*arctanh(1/2*(9-8*x)/(sqrt(13)*sqrt(2-x+3*x^2)))/sqrt(13)+11/104*(7+10*x)*sqrt(2-x+3*x^2)/(1+2*x)],
[(1+2*x)^3*(2-x+3*x^2)^(3/2)*(1+3*x+4*x^2),x,9,54593/559872*(1-6*x)*(2-x+3*x^2)^(3/2)-11/58320*(283-5850*x)*(2-x+3*x^2)^(5/2)+913/486*x^2*(2-x+3*x^2)^(5/2)+77/81*x^3*(2-x+3*x^2)^(5/2)+2/27*(1+2*x)^4*(2-x+3*x^2)^(5/2)+28879697/8957952*arcsinh((1-6*x)/sqrt(23))/sqrt(3)+1255639/4478976*(1-6*x)*sqrt(2-x+3*x^2)],
[(1+2*x)^2*(2-x+3*x^2)^(3/2)*(1+3*x+4*x^2),x,7,91/3456*(1-6*x)*(2-x+3*x^2)^(3/2)+8/63*(1+2*x)^2*(2-x+3*x^2)^(5/2)+1/12*(1+2*x)^3*(2-x+3*x^2)^(5/2)+13/2520*(29+50*x)*(2-x+3*x^2)^(5/2)+48139/55296*arcsinh((1-6*x)/sqrt(23))/sqrt(3)+2093/27648*(1-6*x)*sqrt(2-x+3*x^2)],
[(1+2*x)*(2-x+3*x^2)^(3/2)*(1+3*x+4*x^2),x,6,-71/2592*(1-6*x)*(2-x+3*x^2)^(3/2)+2/21*(1+2*x)^2*(2-x+3*x^2)^(5/2)+1/378*(109+102*x)*(2-x+3*x^2)^(5/2)-37559/41472*arcsinh((1-6*x)/sqrt(23))/sqrt(3)-1633/20736*(1-6*x)*sqrt(2-x+3*x^2)],
[(2-x+3*x^2)^(3/2)*(1+3*x+4*x^2)/(1+2*x),x,8,1/144*(7+30*x)*(2-x+3*x^2)^(3/2)+2/15*(2-x+3*x^2)^(5/2)+2203/2304*arcsinh((1-6*x)/sqrt(23))/sqrt(3)-13/32*arctanh(1/2*(9-8*x)/(sqrt(13)*sqrt(2-x+3*x^2)))*sqrt(13)+1/1152*(869+402*x)*sqrt(2-x+3*x^2)],
[(2-x+3*x^2)^(3/2)*(1+3*x+4*x^2)/(1+2*x)^2,x,8,-1/104*(23-38*x)*(2-x+3*x^2)^(3/2)-1/13*(2-x+3*x^2)^(5/2)/(1+2*x)-2327/384*arcsinh((1-6*x)/sqrt(23))/sqrt(3)+25/32*arctanh(1/2*(9-8*x)/(sqrt(13)*sqrt(2-x+3*x^2)))*sqrt(13)-1/192*(349-294*x)*sqrt(2-x+3*x^2)],
[(2-x+3*x^2)^(3/2)*(1+3*x+4*x^2)/(1+2*x)^3,x,8,1/312*(151+122*x)*(2-x+3*x^2)^(3/2)/(1+2*x)-1/26*(2-x+3*x^2)^(5/2)/(1+2*x)^2+1519/192*arcsinh((1-6*x)/sqrt(23))/sqrt(3)-1153/64*arctanh(1/2*(9-8*x)/(sqrt(13)*sqrt(2-x+3*x^2)))/sqrt(13)+1/624*(1858-771*x)*sqrt(2-x+3*x^2)],
[(1+2*x)^3*(2-x+3*x^2)^(5/2)*(1+3*x+4*x^2),x,9,117047/1492992*(1-6*x)*(2-x+3*x^2)^(3/2)+5089/155520*(1-6*x)*(2-x+3*x^2)^(5/2)-1/498960*(26353-21350*x)*(2-x+3*x^2)^(7/2)+133/1485*(1+2*x)^2*(2-x+3*x^2)^(7/2)+29/330*(1+2*x)^3*(2-x+3*x^2)^(7/2)+2/33*(1+2*x)^4*(2-x+3*x^2)^(7/2)+61917863/23887872*arcsinh((1-6*x)/sqrt(23))/sqrt(3)+2692081/11943936*(1-6*x)*sqrt(2-x+3*x^2)],
[(1+2*x)^2*(2-x+3*x^2)^(5/2)*(1+3*x+4*x^2),x,8,-6739/559872*(1-6*x)*(2-x+3*x^2)^(3/2)-293/58320*(1-6*x)*(2-x+3*x^2)^(5/2)+37/405*(1+2*x)^2*(2-x+3*x^2)^(7/2)+1/15*(1+2*x)^3*(2-x+3*x^2)^(7/2)+1/17010*(2731+3430*x)*(2-x+3*x^2)^(7/2)-3564931/8957952*arcsinh((1-6*x)/sqrt(23))/sqrt(3)-154997/4478976*(1-6*x)*sqrt(2-x+3*x^2)],
[(1+2*x)*(2-x+3*x^2)^(5/2)*(1+3*x+4*x^2),x,7,-51175/746496*(1-6*x)*(2-x+3*x^2)^(3/2)-445/15552*(1-6*x)*(2-x+3*x^2)^(5/2)+2/27*(1+2*x)^2*(2-x+3*x^2)^(7/2)+1/648*(137+122*x)*(2-x+3*x^2)^(7/2)-27071575/11943936*arcsinh((1-6*x)/sqrt(23))/sqrt(3)-1177025/5971968*(1-6*x)*sqrt(2-x+3*x^2)],
[(2-x+3*x^2)^(5/2)*(1+3*x+4*x^2)/(1+2*x),x,9,1/10368*(2449+2154*x)*(2-x+3*x^2)^(3/2)+1/1080*(29+150*x)*(2-x+3*x^2)^(5/2)+2/21*(2-x+3*x^2)^(7/2)+944521/165888*arcsinh((1-6*x)/sqrt(23))/sqrt(3)-169/128*arctanh(1/2*(9-8*x)/(sqrt(13)*sqrt(2-x+3*x^2)))*sqrt(13)+1/82944*(221999-17850*x)*sqrt(2-x+3*x^2)],
[(2-x+3*x^2)^(5/2)*(1+3*x+4*x^2)/(1+2*x)^2,x,9,-11/864*(67-78*x)*(2-x+3*x^2)^(3/2)-11/2340*(37-60*x)*(2-x+3*x^2)^(5/2)-1/13*(2-x+3*x^2)^(7/2)/(1+2*x)-315623/13824*arcsinh((1-6*x)/sqrt(23))/sqrt(3)+429/128*arctanh(1/2*(9-8*x)/(sqrt(13)*sqrt(2-x+3*x^2)))*sqrt(13)-11/6912*(4727-3090*x)*sqrt(2-x+3*x^2)],
[(2-x+3*x^2)^(5/2)*(1+3*x+4*x^2)/(1+2*x)^3,x,9,1/832*(1227-838*x)*(2-x+3*x^2)^(3/2)+1/520*(257+134*x)*(2-x+3*x^2)^(5/2)/(1+2*x)-1/26*(2-x+3*x^2)^(7/2)/(1+2*x)^2+118423/3072*arcsinh((1-6*x)/sqrt(23))/sqrt(3)-1631/256*arctanh(1/2*(9-8*x)/(sqrt(13)*sqrt(2-x+3*x^2)))*sqrt(13)+1/1536*(21317-10470*x)*sqrt(2-x+3*x^2)],

# p<0
[(g+h*x)^3*(d+e*x+f*x^2)/sqrt(a+b*x+c*x^2),x,6,1/256*(256*c^5*d*g^3-63*b^5*f*h^3+70*b^3*c*h^2*(3*b*f*g+b*e*h+4*a*f*h)-80*b*c^2*h*(3*a^2*f*h^2+3*a*b*h*(3*f*g+e*h)+b^2*(3*f*g^2+3*e*g*h+d*h^2))-128*c^4*g*(b*g*(e*g+3*d*h)+a*(f*g^2+3*h*(e*g+d*h)))+96*c^3*(a^2*h^2*(3*f*g+e*h)+b^2*g*(f*g^2+3*h*(e*g+d*h))+2*a*b*h*(3*f*g^2+h*(3*e*g+d*h))))*arctanh(1/2*(b+2*c*x)/(sqrt(c)*sqrt(a+b*x+c*x^2)))/c^(11/2)+1/240*(63*b^2*f*h^2-2*c*h*(24*b*f*g+35*b*e*h+32*a*f*h)-c^2*(12*f*g^2-20*h*(3*e*g+4*d*h)))*(g+h*x)^2*sqrt(a+b*x+c*x^2)/(c^3*h)-1/40*(9*b*f*h+2*c*(f*g-5*e*h))*(g+h*x)^3*sqrt(a+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rt(13)-1/13*sqrt(2-x+3*x^2)/(1+2*x)],
[(1+3*x+4*x^2)/((1+2*x)^3*sqrt(2-x+3*x^2)),x,4,-581/676*arctanh(1/2*(9-8*x)/(sqrt(13)*sqrt(2-x+3*x^2)))/sqrt(13)-1/26*sqrt(2-x+3*x^2)/(1+2*x)^2+7/169*sqrt(2-x+3*x^2)/(1+2*x)],
[(1+2*x)^3*(1+3*x+4*x^2)/(2-x+3*x^2)^(3/2),x,6,353/81*arcsinh((1-6*x)/sqrt(23))/sqrt(3)+2/1863*(12839-3871*x)/sqrt(2-x+3*x^2)+746/81*sqrt(2-x+3*x^2)+412/81*x*sqrt(2-x+3*x^2)+32/27*x^2*sqrt(2-x+3*x^2)],
[(1+2*x)^2*(1+3*x+4*x^2)/(2-x+3*x^2)^(3/2),x,5,-64/9*arcsinh((1-6*x)/sqrt(23))/sqrt(3)+2/621*(1249-2273*x)/sqrt(2-x+3*x^2)+112/27*sqrt(2-x+3*x^2)+8/9*x*sqrt(2-x+3*x^2)],
[(1+2*x)*(1+3*x+4*x^2)/(2-x+3*x^2)^(3/2),x,4,-14/3*arcsinh((1-6*x)/sqrt(23))/sqrt(3)-2/207*(73+367*x)/sqrt(2-x+3*x^2)+8/9*sqrt(2-x+3*x^2)],
[(1+3*x+4*x^2)/((1+2*x)*(2-x+3*x^2)^(3/2)),x,4,-2/13*arctanh(1/2*(9-8*x)/(sqrt(13)*sqrt(2-x+3*x^2)))/sqrt(13)-2/299*(101-77*x)/sqrt(2-x+3*x^2)],
[(1+3*x+4*x^2)/((1+2*x)^2*(2-x+3*x^2)^(3/2)),x,4,2/169*arctanh(1/2*(9-8*x)/(sqrt(13)*sqrt(2-x+3*x^2)))/sqrt(13)-2/3887*(197-837*x)/sqrt(2-x+3*x^2)-4/169*sqrt(2-x+3*x^2)/(1+2*x)],
[(1+3*x+4*x^2)/((1+2*x)^3*(2-x+3*x^2)^(3/2)),x,5,-487/2197*arctanh(1/2*(9-8*x)/(sqrt(13)*sqrt(2-x+3*x^2)))/sqrt(13)+2/50531*(2363+3693*x)/sqrt(2-x+3*x^2)-2/169*sqrt(2-x+3*x^2)/(1+2*x)^2-4/2197*sqrt(2-x+3*x^2)/(1+2*x)],
[(1+2*x)^3*(1+3*x+4*x^2)/(2-x+3*x^2)^(5/2),x,5,2/5589*(12839-3871*x)/(2-x+3*x^2)^(3/2)-296/27*arcsinh((1-6*x)/sqrt(23))/sqrt(3)-28/128547*(35809+42240*x)/sqrt(2-x+3*x^2)+32/27*sqrt(2-x+3*x^2)],
[(1+2*x)^2*(1+3*x+4*x^2)/(2-x+3*x^2)^(5/2),x,5,2/1863*(1249-2273*x)/(2-x+3*x^2)^(3/2)-16/9*arcsinh((1-6*x)/sqrt(23))/sqrt(3)-8/42849*(23257-1473*x)/sqrt(2-x+3*x^2)],
[(1+2*x)*(1+3*x+4*x^2)/(2-x+3*x^2)^(5/2),x,2,-2/621*(73+367*x)/(2-x+3*x^2)^(3/2)-4/14283*(3889-4290*x)/sqrt(2-x+3*x^2)],
[(1+3*x+4*x^2)/((1+2*x)*(2-x+3*x^2)^(5/2)),x,5,-2/897*(101-77*x)/(2-x+3*x^2)^(3/2)-8/169*arctanh(1/2*(9-8*x)/(sqrt(13)*sqrt(2-x+3*x^2)))/sqrt(13)-4/268203*(691-13668*x)/sqrt(2-x+3*x^2)],
[(1+3*x+4*x^2)/((1+2*x)^2*(2-x+3*x^2)^(5/2)),x,5,-2/11661*(197-837*x)/(2-x+3*x^2)^(3/2)-56/2197*arctanh(1/2*(9-8*x)/(sqrt(13)*sqrt(2-x+3*x^2)))/sqrt(13)-24/1162213*(841-6633*x)/sqrt(2-x+3*x^2)-16/2197*sqrt(2-x+3*x^2)/(1+2*x)],
[(1+3*x+4*x^2)/((1+2*x)^3*(2-x+3*x^2)^(5/2)),x,6,2/151593*(2363+3693*x)/(2-x+3*x^2)^(3/2)-2084/28561*arctanh(1/2*(9-8*x)/(sqrt(13)*sqrt(2-x+3*x^2)))/sqrt(13)+12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*(-2*c*e^2+2*c*d*f-c*e^2*p+2*c*f^2*(3+2*p)*x^2),x,2,-c*e*(2+p)*(d+e*x+f*x^2)^(1+p)/(1+p)+2*c*f*x*(d+e*x+f*x^2)^(1+p)],
[(d+e*x+f*x^2)^p*(-2*c*e^2+2*c*d*f+3*b*e*f-c*e^2*p+2*b*e*f*p+2*b*f^2*(3+2*p)*x+2*c*f^2*(3+2*p)*x^2),x,2,-(c*e*(2+p)-b*f*(3+2*p))*(d+e*x+f*x^2)^(1+p)/(1+p)+2*c*f*x*(d+e*x+f*x^2)^(1+p)],

# Integrands of the form P3[x] (d+e x)^m (a+b x+c x^2)^p

# Integrands of the form P3[x] (d+e x)^m (a+b x+c x^2)^p when b^2-4 a c=0

# Integrands of the form P3[x] (d+e x)^m (a+b x+c x^2)^p when b=0

# Integrands of the form P3[x] (d+e x)^m (a+b x+c x^2)^p

# Integrands of the form P3[x] (d+e x)^m (a+b x+c x^2)^p

# p>0
[(d+e*x)^3*(a+b*x+c*x^2)^5*(d*(6*b*d+5*a*e)+(12*c*d^2+17*b*d*e+5*a*e^2)*x+e*(29*c*d+11*b*e)*x^2+17*c*e^2*x^3),x,2,(d+e*x)^5*(a+b*x+c*x^2)^6],

# p<0
[(x^2+x^3)/(-2+x+x^2),x,6,1/2*x^2+2/3*log(1-x)+4/3*log(2+x)],

# Integrands of the form P3[x] (d+e x)^m (a+b x+c x^2)^(p/2)

# p>0

# p<0
[x^2*(d+e*x+f*x^2+g*x^3)/sqrt(a+b*x+c*x^2),x,6,1/256*(70*b^4*c*f+48*b^2*c^2*(2*c*d-5*a*f)-32*a*c^3*(4*c*d-3*a*f)-63*b^5*g-40*b^3*c*(2*c*e-7*a*g)+48*a*b*c^2*(4*c*e-5*a*g))*arctanh(1/2*(b+2*c*x)/(sqrt(c)*sqrt(a+b*x+c*x^2)))/c^(11/2)+1/240*(80*c^2*e-70*b*c*f+63*b^2*g-64*a*c*g)*x^2*sqrt(a+b*x+c*x^2)/c^3+1/40*(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x,6,-1/128*(35*b^4*d-40*a*b^3*e+16*a^2*c*(3*c*d-4*a*f)-24*a*b^2*(5*c*d-2*a*f)+32*a^2*b*(3*c*e-2*a*g))*arctanh(1/2*(2*a+b*x)/(sqrt(a)*sqrt(a+b*x+c*x^2)))/a^(9/2)-1/4*d*sqrt(a+b*x+c*x^2)/(a*x^4)+1/24*(7*b*d-8*a*e)*sqrt(a+b*x+c*x^2)/(a^2*x^3)-1/96*(35*b^2*d-36*a*c*d-40*a*b*e+48*a^2*f)*sqrt(a+b*x+c*x^2)/(a^3*x^2)+1/192*(105*b^3*d-120*a*b^2*e-4*a*b*(55*c*d-36*a*f)+64*a^2*(2*c*e-3*a*g))*sqrt(a+b*x+c*x^2)/(a^4*x)],
[(d+e*x+f*x^2+g*x^3)/(x^6*sqrt(a+b*x+c*x^2)),x,7,1/256*(63*b^5*d-70*a*b^4*e+48*a^2*b*c*(5*c*d-4*a*f)-40*a*b^3*(7*c*d-2*a*f)-32*a^3*c*(3*c*e-4*a*g)+48*a^2*b^2*(5*c*e-2*a*g))*arctanh(1/2*(2*a+b*x)/(sqrt(a)*sqrt(a+b*x+c*x^2)))/a^(11/2)-1/5*d*sqrt(a+b*x+c*x^2)/(a*x^5)+1/40*(9*b*d-10*a*e)*sqrt(a+b*x+c*x^2)/(a^2*x^4)-1/240*(63*b^2*d-64*a*c*d-70*a*b*e+80*a^2*f)*sqrt(a+b*x+c*x^2)/(a^3*x^3)+1/960*(315*b^3*d-350*a*b^2*e-4*a*b*(161*c*d-100*a*f)+120*a^2*(3*c*e-4*a*g))*sqrt(a+b*x+c*x^2)/(a^4*x^2)-1/1920*(945*b^4*d-1050*a*b^3*e-60*a*b^2*(49*c*d-20*a*f)+256*a^2*c*(4*c*d-5*a*f)+40*a^2*b*(55*c*e-36*a*g))*sqrt(a+b*x+c*x^2)/(a^5*x)],

# Integrands of the form (d+e x)^m (a+b x+c x^2)^p (f+g x+h x^2) when m and/or p symbolic

# Integrands of the form P4[x] (d+e x)^m (a+b x+c x^2)^p

# Integrands of the form P4[x] (d+e x)^m (a+b x+c x^2)^p when b=0

# Integrands of the form P4[x] (d+e x)^m (a+b x+c x^2)^p

# Integrands of the form P4[x] (d+e x)^m (a+b x+c x^2)^p

# p>0
[(d+e*x)^3*(3+2*x+5*x^2)*(2+x+3*x^2-5*x^3+4*x^4),x,2,1/4*(5*d^2-2*d*e+3*e^2)*(4*d^4+5*d^3*e+3*d^2*e^2-d*e^3+2*e^4)*(d+e*x)^4/e^7-1/5*(120*d^5+85*d^4*e+68*d^3*e^2+12*d^2*e^3+42*d*e^4-7*e^5)*(d+e*x)^5/e^7+1/6*(300*d^4+170*d^3*e+102*d^2*e^2+12*d*e^3+21*e^4)*(d+e*x)^6/e^7-2/7*(200*d^3+85*d^2*e+34*d*e^2+2*e^3)*(d+e*x)^7/e^7+1/8*(300*d^2+85*d*e+17*e^2)*(d+e*x)^8/e^7-1/9*(120*d+17*e)*(d+e*x)^9/e^7+2*(d+e*x)^10/e^7],
[(d+e*x)^2*(3+2*x+5*x^2)*(2+x+3*x^2-5*x^3+4*x^4),x,2,6*d^2*x+1/2*d*(7*d+12*e)*x^2+1/3*(21*d^2+14*d*e+6*e^2)*x^3-1/4*(4*d^2-42*d*e-7*e^2)*x^4+1/5*(17*d^2-8*d*e+21*e^2)*x^5-1/6*(17*d^2-34*d*e+4*e^2)*x^6+1/7*(20*d^2-34*d*e+17*e^2)*x^7+1/8*(40*d-17*e)*e*x^8+20/9*e^2*x^9],
[(d+e*x)*(3+2*x+5*x^2)*(2+x+3*x^2-5*x^3+4*x^4),x,2,6*d*x+1/2*(7*d+6*e)*x^2+7/3*(3*d+e)*x^3-1/4*(4*d-21*e)*x^4+1/5*(17*d-4*e)*x^5-17/6*(d-e)*x^6+1/7*(20*d-17*e)*x^7+5/2*e*x^8],
[(3+2*x+5*x^2)*(2+x+3*x^2-5*x^3+4*x^4),x,2,6*x+7/2*x^2+7*x^3-x^4+17/5*x^5-17/6*x^6+20/7*x^7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^7],
[(d+e*x)^3*(3+2*x+5*x^2)^2*(2+x+3*x^2-5*x^3+4*x^4),x,2,1/4*(5*d^2-2*d*e+3*e^2)^2*(4*d^4+5*d^3*e+3*d^2*e^2-d*e^3+2*e^4)*(d+e*x)^4/e^9-1/5*(5*d^2-2*d*e+3*e^2)*(160*d^5+127*d^4*e+88*d^3*e^2-4*d^2*e^3+64*d*e^4-11*e^5)*(d+e*x)^5/e^9+1/6*(2800*d^6+945*d^5*e+1665*d^4*e^2+370*d^3*e^3+888*d^2*e^4-195*d*e^5+107*e^6)*(d+e*x)^6/e^9-1/7*(5600*d^5+1575*d^4*e+2220*d^3*e^2+370*d^2*e^3+592*d*e^4-65*e^5)*(d+e*x)^7/e^9+1/8*(7000*d^4+1575*d^3*e+1665*d^2*e^2+185*d*e^3+148*e^4)*(d+e*x)^8/e^9-1/9*(5600*d^3+945*d^2*e+666*d*e^2+37*e^3)*(d+e*x)^9/e^9+1/10*(2800*d^2+315*d*e+111*e^2)*(d+e*x)^10/e^9-5/11*(160*d+9*e)*(d+e*x)^11/e^9+25/3*(d+e*x)^12/e^9],
[(d+e*x)^2*(3+2*x+5*x^2)^2*(2+x+3*x^2-5*x^3+4*x^4),x,2,18*d^2*x+3/2*d*(11*d+12*e)*x^2+1/3*(107*d^2+66*d*e+18*e^2)*x^3+1/4*(65*d^2+214*d*e+33*e^2)*x^4+1/5*(148*d^2+130*d*e+107*e^2)*x^5-1/6*(37*d^2-296*d*e-65*e^2)*x^6+37/7*(3*d^2-2*d*e+4*e^2)*x^7-1/8*(45*d^2-222*d*e+37*e^2)*x^8+1/9*(100*d^2-90*d*e+111*e^2)*x^9+1/2*(40*d-9*e)*e*x^10+100/11*e^2*x^11],
[(d+e*x)*(3+2*x+5*x^2)^2*(2+x+3*x^2-5*x^3+4*x^4),x,2,18*d*x+3/2*(11*d+6*e)*x^2+1/3*(107*d+33*e)*x^3+1/4*(65*d+107*e)*x^4+1/5*(148*d+65*e)*x^5-37/6*(d-4*e)*x^6+37/7*(3*d-e)*x^7-3/8*(15*d-37*e)*x^8+5/9*(20*d-9*e)*x^9+10*e*x^10],
[(3+2*x+5*x^2)^2*(2+x+3*x^2-5*x^3+4*x^4),x,2,18*x+33/2*x^2+107/3*x^3+65/4*x^4+148/5*x^5-37/6*x^6+111/7*x^7-45/8*x^8+100/9*x^9],
[(3+2*x+5*x^2)^2*(2+x+3*x^2-5*x^3+4*x^4)/(d+e*x),x,2,-(100*d^7+45*d^6*e+111*d^5*e^2+37*d^4*e^3+148*d^3*e^4-65*d^2*e^5+107*d*e^6-33*e^7)*x/e^8+1/2*(100*d^6+45*d^5*e+111*d^4*e^2+37*d^3*e^3+148*d^2*e^4-65*d*e^5+107*e^6)*x^2/e^7-1/3*(100*d^5+45*d^4*e+111*d^3*e^2+37*d^2*e^3+148*d*e^4-65*e^5)*x^3/e^6+1/4*(100*d^4+45*d^3*e+111*d^2*e^2+37*d*e^3+148*e^4)*x^4/e^5-1/5*(100*d^3+45*d^2*e+111*d*e^2+37*e^3)*x^5/e^4+1/6*(100*d^2+45*d*e+111*e^2)*x^6/e^3-5/7*(20*d+9*e)*x^7/e^2+25/2*x^8/e+(5*d^2-2*d*e+3*e^2)^2*(4*d^4+5*d^3*e+3*d^2*e^2-d*e^3+2*e^4)*log(d+e*x)/e^9],
[(3+2*x+5*x^2)^2*(2+x+3*x^2-5*x^3+4*x^4)/(d+e*x)^2,x,2,(700*d^6+270*d^5*e+555*d^4*e^2+148*d^3*e^3+444*d^2*e^4-130*d*e^5+107*e^6)*x/e^8-1/2*(600*d^5+225*d^4*e+444*d^3*e^2+111*d^2*e^3+296*d*e^4-65*e^5)*x^2/e^7+1/3*(500*d^4+180*d^3*e+333*d^2*e^2+74*d*e^3+148*e^4)*x^3/e^6-1/4*(400*d^3+135*d^2*e+222*d*e^2+37*e^3)*x^4/e^5+3/5*(100*d^2+30*d*e+37*e^2)*x^5/e^4-5/6*(40*d+9*e)*x^6/e^3+100/7*x^7/e^2-(5*d^2-2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^5)/(e^9*(d+e*x)^2)+(-2800*d^6-945*d^5*e-1665*d^4*e^2-370*d^3*e^3-888*d^2*e^4+195*d*e^5-107*e^6)/(e^9*(d+e*x))-(5600*d^5+1575*d^4*e+2220*d^3*e^2+370*d^2*e^3+592*d*e^4-65*e^5)*log(d+e*x)/e^9],

# p<0
[(d+e*x)^3*(2+x+3*x^2-5*x^3+4*x^4)/(3+2*x+5*x^2),x,6,1/15625*(10125*d^3+34350*d^2*e-13215*d*e^2-5108*e^3)*x-1/6250*(4125*d^3-6075*d^2*e-6870*d*e^2+881*e^3)*x^2+1/1875*(500*d^3-2475*d^2*e+1215*d*e^2+458*e^3)*x^3+3/500*e*(100*d^2-165*d*e+27*e^2)*x^4+3/125*(20*d-11*e)*e^2*x^5+2/15*e^3*x^6+1/156250*(57250*d^3-66075*d^2*e-76620*d*e^2+23431*e^3)*log(3+2*x+5*x^2)-1/78125*(52875*d^3+449175*d^2*e-274845*d*e^2-53189*e^3)*arctan((1+5*x)/sqrt(14))/sqrt(14)],
[(d+e*x)^2*(2+x+3*x^2-5*x^3+4*x^4)/(3+2*x+5*x^2),x,6,1/3125*(2025*d^2+4580*d*e-881*e^2)*x-1/1250*(825*d^2-810*d*e-458*e^2)*x^2+1/375*(100*d^2-330*d*e+81*e^2)*x^3+1/100*(40*d-33*e)*e*x^4+4/25*e^2*x^5+1/15625*(5725*d^2-4405*d*e-2554*e^2)*log(3+2*x+5*x^2)-1/15625*(10575*d^2+59890*d*e-18323*e^2)*arctan((1+5*x)/sqrt(14))/sqrt(14)],
[(d+e*x)*(2+x+3*x^2-5*x^3+4*x^4)/(3+2*x+5*x^2),x,6,1/625*(405*d+458*e)*x-3/250*(55*d-27*e)*x^2+1/75*(20*d-33*e)*x^3+1/5*e*x^4+1/6250*(2290*d-881*e)*log(3+2*x+5*x^2)-1/3125*(2115*d+5989*e)*arctan((1+5*x)/sqrt(14))/sqrt(14)],
[(2+x+3*x^2-5*x^3+4*x^4)/(3+2*x+5*x^2),x,6,81/125*x-33/50*x^2+4/15*x^3+229/625*log(3+2*x+5*x^2)-423/625*arctan((1+5*x)/sqrt(14))/sqrt(14)],
[(2+x+3*x^2-5*x^3+4*x^4)/((d+e*x)*(3+2*x+5*x^2)),x,6,-1/25*(20*d+33*e)*x/e^2+2/5*x^2/e+(4*d^4+5*d^3*e+3*d^2*e^2-d*e^3+2*e^4)*log(d+e*x)/(e^3*(5*d^2-2*d*e+3*e^2))+1/250*(458*d-7*e)*log(3+2*x+5*x^2)/(5*d^2-2*d*e+3*e^2)-1/125*(423*d-1367*e)*arctan((1+5*x)/sqrt(14))/((5*d^2-2*d*e+3*e^2)*sqrt(14))],
[(2+x+3*x^2-5*x^3+4*x^4)/((d+e*x)^2*(3+2*x+5*x^2)),x,6,4/5*x/e^2+(-4*d^4-5*d^3*e-3*d^2*e^2+d*e^3-2*e^4)/(e^3*(5*d^2-2*d*e+3*e^2)*(d+e*x))-(40*d^5+d^4*e+28*d^3*e^2+44*d^2*e^3-2*d*e^4+e^5)*log(d+e*x)/(e^3*(5*d^2-2*d*e+3*e^2)^2)+1/25*(229*d^2-7*d*e-136*e^2)*log(3+2*x+5*x^2)/(5*d^2-2*d*e+3*e^2)^2-1/25*(423*d^2-2734*d*e+293*e^2)*arctan((1+5*x)/sqrt(14))/((5*d^2-2*d*e+3*e^2)^2*sqrt(14))],
[(2+x+3*x^2-5*x^3+4*x^4)/((d+e*x)^3*(3+2*x+5*x^2)),x,6,1/2*(-4*d^4-5*d^3*e-3*d^2*e^2+d*e^3-2*e^4)/(e^3*(5*d^2-2*d*e+3*e^2)*(d+e*x)^2)+(40*d^5+d^4*e+28*d^3*e^2+44*d^2*e^3-2*d*e^4+e^5)/(e^3*(5*d^2-2*d*e+3*e^2)^2*(d+e*x))+(100*d^6-120*d^5*e+228*d^4*e^2-242*d^3*e^3+141*d^2*e^4+120*d*e^5-e^6)*log(d+e*x)/(e^3*(5*d^2-2*d*e+3*e^2)^3)+1/10*(458*d^3-21*d^2*e-816*d*e^2+113*e^3)*log(3+2*x+5*x^2)/(5*d^2-2*d*e+3*e^2)^3-1/5*(423*d^3-4101*d^2*e+879*d*e^2+703*e^3)*arctan((1+5*x)/sqrt(14))/((5*d^2-2*d*e+3*e^2)^3*sqrt(14))],
[(d+e*x)^3*(2+x+3*x^2-5*x^3+4*x^4)/(3+2*x+5*x^2)^2,x,7,1/17500*(2800*d^3-17220*d^2*e+9921*d*e^2+6053*e^3)*x+1/3500*e*(840*d^2-1722*d*e+373*e^2)*x^2+1/375*(60*d-41*e)*e^2*x^3+1/25*e^3*x^4-1/3500*(1367+423*x)*(d+e*x)^3/(3+2*x+5*x^2)-1/6250*(1025*d^3-1545*d^2*e-2601*d*e^2+832*e^3)*log(3+2*x+5*x^2)+1/87500*(32825*d^3+317565*d^2*e-221643*d*e^2-67499*e^3)*arctan((1+5*x)/sqrt(14))/sqrt(14)],
[(d+e*x)^2*(2+x+3*x^2-5*x^3+4*x^4)/(3+2*x+5*x^2)^2,x,7,1/17500*(2800*d^2-11480*d*e+3307*e^2)*x+1/250*(40*d-41*e)*e*x^2+4/75*e^2*x^3-1/3500*(1367+423*x)*(d+e*x)^2/(3+2*x+5*x^2)-1/6250*(1025*d^2-1030*d*e-867*e^2)*log(3+2*x+5*x^2)+1/87500*(32825*d^2+211710*d*e-73881*e^2)*arctan((1+5*x)/sqrt(14))/sqrt(14)],
[(d+e*x)*(2+x+3*x^2-5*x^3+4*x^4)/(3+2*x+5*x^2)^2,x,7,1/125*(20*d-41*e)*x+2/25*e*x^2-1/3500*(1367+423*x)*(d+e*x)/(3+2*x+5*x^2)-1/1250*(205*d-103*e)*log(3+2*x+5*x^2)+1/17500*(6565*d+21171*e)*arctan((1+5*x)/sqrt(14))/sqrt(14)],
[(2+x+3*x^2-5*x^3+4*x^4)/(3+2*x+5*x^2)^2,x,7,4/25*x+1/3500*(-1367-423*x)/(3+2*x+5*x^2)-41/250*log(3+2*x+5*x^2)+1313/3500*arctan((1+5*x)/sqrt(14))/sqrt(14)],
[(2+x+3*x^2-5*x^3+4*x^4)/((d+e*x)*(3+2*x+5*x^2)^2),x,7,1/700*(-1367*d+293*e-(423*d-1367*e)*x)/((5*d^2-2*d*e+3*e^2)*(3+2*x+5*x^2))+(4*d^4+5*d^3*e+3*d^2*e^2-d*e^3+2*e^4)*log(d+e*x)/(e*(5*d^2-2*d*e+3*e^2)^2)-1/50*(205*d^3-61*d^2*e+23*d*e^2+14*e^3)*log(3+2*x+5*x^2)/(5*d^2-2*d*e+3*e^2)^2+1/700*(6565*d^3-26423*d^2*e+11089*d*e^2-6623*e^3)*arctan((1+5*x)/sqrt(14))/((5*d^2-2*d*e+3*e^2)^2*sqrt(14))],
[(2+x+3*x^2-5*x^3+4*x^4)/((d+e*x)^2*(3+2*x+5*x^2)^2),x,7,(-4*d^4-5*d^3*e-3*d^2*e^2+d*e^3-2*e^4)/(e*(5*d^2-2*d*e+3*e^2)^2*(d+e*x))+1/140*(-1367*d^2+586*d*e+703*e^2-(423*d^2-2734*d*e+293*e^2)*x)/((5*d^2-2*d*e+3*e^2)^2*(3+2*x+5*x^2))+(41*d^4-8*d^3*e-60*d^2*e^2+24*d*e^3-5*e^4)*log(d+e*x)/(5*d^2-2*d*e+3*e^2)^3-1/2*(41*d^4-8*d^3*e-60*d^2*e^2+24*d*e^3-5*e^4)*log(3+2*x+5*x^2)/(5*d^2-2*d*e+3*e^2)^3+1/28*(1313*d^4-10044*d^3*e+4290*d^2*e^2+156*d*e^3-271*e^4)*arctan((1+5*x)/sqrt(14))/((5*d^2-2*d*e+3*e^2)^3*sqrt(14))],
[(2+x+3*x^2-5*x^3+4*x^4)/((d+e*x)^3*(3+2*x+5*x^2)^2),x,7,1/2*(-4*d^4-5*d^3*e-3*d^2*e^2+d*e^3-2*e^4)/(e*(5*d^2-2*d*e+3*e^2)^2*(d+e*x)^2)+(-41*d^4+8*d^3*e+60*d^2*e^2-24*d*e^3+5*e^4)/((5*d^2-2*d*e+3*e^2)^3*(d+e*x))+1/28*(-1367*d^3+879*d^2*e+2109*d*e^2-457*e^3-(423*d^3-4101*d^2*e+879*d*e^2+703*e^3)*x)/((5*d^2-2*d*e+3*e^2)^3*(3+2*x+5*x^2))+(205*d^5-19*d^4*e-846*d^3*e^2+396*d^2*e^3+57*d*e^4-21*e^5)*log(d+e*x)/(5*d^2-2*d*e+3*e^2)^4-1/2*(205*d^5-19*d^4*e-846*d^3*e^2+396*d^2*e^3+57*d*e^4-21*e^5)*log(3+2*x+5*x^2)/(5*d^2-2*d*e+3*e^2)^4+1/28*(6565*d^5-74017*d^4*e+35022*d^3*e^2+42858*d^2*e^3-17247*d*e^4+579*e^5)*arctan((1+5*x)/sqrt(14))/((5*d^2-2*d*e+3*e^2)^4*sqrt(14))],
[(d+e*x)^3*(2+x+3*x^2-5*x^3+4*x^4)/(3+2*x+5*x^2)^3,x,8,1/980000*(83065*d-126009*e)*e^2*x+2/125*e^3*x^2-1/7000*(1367+423*x)*(d+e*x)^3/(3+2*x+5*x^2)^2+1/196000*(d+e*x)^2*(3*(11449*d-2105*e)+(11015*d+49177*e)*x)/(3+2*x+5*x^2)+3/6250*e*(100*d^2-245*d*e+47*e^2)*log(3+2*x+5*x^2)+3/4900000*(353125*d^3-855175*d^2*e+74085*d*e^2+556349*e^3)*arctan((1+5*x)/sqrt(14))/sqrt(14)],
[(d+e*x)^2*(2+x+3*x^2-5*x^3+4*x^4)/(3+2*x+5*x^2)^3,x,8,4/125*e^2*x-1/7000*(1367+423*x)*(d+e*x)^2/(3+2*x+5*x^2)^2+1/196000*(d+e*x)*(34347*d-6413*e+5*(2203*d+8553*e)*x)/(3+2*x+5*x^2)+1/1250*(40*d-49*e)*e*log(3+2*x+5*x^2)+1/980000*(211875*d^2-342070*d*e+14817*e^2)*arctan((1+5*x)/sqrt(14))/sqrt(14)],
[(d+e*x)*(2+x+3*x^2-5*x^3+4*x^4)/(3+2*x+5*x^2)^3,x,6,-1/7000*(1367+423*x)*(d+e*x)/(3+2*x+5*x^2)^2+1/196000*(34347*d-6511*e+(11015*d+36353*e)*x)/(3+2*x+5*x^2)+2/125*e*log(3+2*x+5*x^2)+1/196000*(42375*d-34207*e)*arctan((1+5*x)/sqrt(14))/sqrt(14)],
[(2+x+3*x^2-5*x^3+4*x^4)/(3+2*x+5*x^2)^3,x,5,1/7000*(-1367-423*x)/(3+2*x+5*x^2)^2+1/196000*(34347+11015*x)/(3+2*x+5*x^2)+339/1568*arctan((1+5*x)/sqrt(14))/sqrt(14)],
[(2+x+3*x^2-5*x^3+4*x^4)/((d+e*x)*(3+2*x+5*x^2)^3),x,8,1/1400*(-1367*d+293*e-(423*d-1367*e)*x)/((5*d^2-2*d*e+3*e^2)*(3+2*x+5*x^2)^2)+1/39200*(171735*d^3-92989*d^2*e+36207*d*e^2+1831*e^3+25*(2203*d^3-9033*d^2*e+3635*d*e^2-1829*e^3)*x)/((5*d^2-2*d*e+3*e^2)^2*(3+2*x+5*x^2))+e*(4*d^4+5*d^3*e+3*d^2*e^2-d*e^3+2*e^4)*log(d+e*x)/(5*d^2-2*d*e+3*e^2)^3-1/2*e*(4*d^4+5*d^3*e+3*d^2*e^2-d*e^3+2*e^4)*log(3+2*x+5*x^2)/(5*d^2-2*d*e+3*e^2)^3+1/1568*(42375*d^5-16643*d^4*e+58530*d^3*e^2-56058*d^2*e^3+31811*d*e^4-8623*e^5)*arctan((1+5*x)/sqrt(14))/((5*d^2-2*d*e+3*e^2)^3*sqrt(14))],
[(2+x+3*x^2-5*x^3+4*x^4)/((d+e*x)^2*(3+2*x+5*x^2)^3),x,8,-e*(4*d^4+5*d^3*e+3*d^2*e^2-d*e^3+2*e^4)/((5*d^2-2*d*e+3*e^2)^3*(d+e*x))+1/280*(-1367*d^2+586*d*e+703*e^2-(423*d^2-2734*d*e+293*e^2)*x)/((5*d^2-2*d*e+3*e^2)^2*(3+2*x+5*x^2)^2)+1/7840*(171735*d^4-117284*d^3*e-200502*d^2*e^2+104428*d*e^3-23189*e^4+5*(11015*d^4-85924*d^3*e+34698*d^2*e^2+10348*d*e^3-3589*e^4)*x)/((5*d^2-2*d*e+3*e^2)^3*(3+2*x+5*x^2))+e*(40*d^5+83*d^4*e+12*d^3*e^2-76*d^2*e^3+46*d*e^4-9*e^5)*log(d+e*x)/(5*d^2-2*d*e+3*e^2)^4-1/2*e*(40*d^5+83*d^4*e+12*d^3*e^2-76*d^2*e^3+46*d*e^4-9*e^5)*log(3+2*x+5*x^2)/(5*d^2-2*d*e+3*e^2)^4+1/1568*(211875*d^6+3070*d^5*e+209039*d^4*e^2-921444*d^3*e^3+380621*d^2*e^4-49586*d*e^5-43695*e^6)*arctan((1+5*x)/sqrt(14))/((5*d^2-2*d*e+3*e^2)^4*sqrt(14))],

# Integrands of the form x^m P4[x] (a+b x+c x^2)^(p/2)

# p>0
[(5+2*x)*(2+x+3*x^2-x^3+5*x^4)*sqrt(3-x+2*x^2),x,7,11433/4480*(5+2*x)^2*(3-x+2*x^2)^(3/2)-823/1344*(5+2*x)^3*(3-x+2*x^2)^(3/2)+5/112*(5+2*x)^4*(3-x+2*x^2)^(3/2)-1/71680*(1005757+295276*x)*(3-x+2*x^2)^(3/2)-1183005/65536*arcsinh((1-4*x)/sqrt(23))/sqrt(2)-51435/32768*(1-4*x)*sqrt(3-x+2*x^2)],
[(2+x+3*x^2-x^3+5*x^4)*sqrt(3-x+2*x^2),x,7,287/5120*(3-x+2*x^2)^(3/2)-71/1280*x*(3-x+2*x^2)^(3/2)+7/80*x^2*(3-x+2*x^2)^(3/2)+5/12*x^3*(3-x+2*x^2)^(3/2)-106007/32768*arcsinh((1-4*x)/sqrt(23))/sqrt(2)-4609/16384*(1-4*x)*sqrt(3-x+2*x^2)],
[(2+x+3*x^2-x^3+5*x^4)*sqrt(3-x+2*x^2)/(5+2*x),x,9,4535/768*(3-x+2*x^2)^(3/2)-127/128*(5+2*x)*(3-x+2*x^2)^(3/2)+1/16*(5+2*x)^2*(3-x+2*x^2)^(3/2)+5627989/8192*arcsinh((1-4*x)/sqrt(23))/sqrt(2)-11001/16*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+1/4096*(489587-80844*x)*sqrt(3-x+2*x^2)],
[(2+x+3*x^2-x^3+5*x^4)*sqrt(3-x+2*x^2)/(5+2*x)^2,x,9,-541/384*(3-x+2*x^2)^(3/2)-3667/576*(3-x+2*x^2)^(3/2)/(5+2*x)+5/64*(5+2*x)*(3-x+2*x^2)^(3/2)-2551847/4096*arcsinh((1-4*x)/sqrt(23))/sqrt(2)+239201/384*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)-1/18432*(1996953-333380*x)*sqrt(3-x+2*x^2)],
[(2+x+3*x^2-x^3+5*x^4)*sqrt(3-x+2*x^2)/(5+2*x)^3,x,9,5/48*(3-x+2*x^2)^(3/2)-3667/1152*(3-x+2*x^2)^(3/2)/(5+2*x)^2+357391/82944*(3-x+2*x^2)^(3/2)/(5+2*x)+117315/512*arcsinh((1-4*x)/sqrt(23))/sqrt(2)-12670805/55296*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+5/82944*(661065-110099*x)*sqrt(3-x+2*x^2)],
[(2+x+3*x^2-x^3+5*x^4)*sqrt(3-x+2*x^2)/(5+2*x)^4,x,9,-3667/1728*(3-x+2*x^2)^(3/2)/(5+2*x)^3+158527/82944*(3-x+2*x^2)^(3/2)/(5+2*x)^2-6467659/5971968*(3-x+2*x^2)^(3/2)/(5+2*x)-10939/256*arcsinh((1-4*x)/sqrt(23))/sqrt(2)+170114729/3981312*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)-1/5971968*(44378877-7400779*x)*sqrt(3-x+2*x^2)],
[(2+x+3*x^2-x^3+5*x^4)*sqrt(3-x+2*x^2)/(5+2*x)^5,x,9,-3667/2304*(3-x+2*x^2)^(3/2)/(5+2*x)^4+593771/497664*(3-x+2*x^2)^(3/2)/(5+2*x)^3-9363383/23887872*(3-x+2*x^2)^(3/2)/(5+2*x)^2+259/64*arcsinh((1-4*x)/sqrt(23))/sqrt(2)-4640586097/1146617856*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+7/95551488*(52836655+9616196*x)*sqrt(3-x+2*x^2)/(5+2*x)],
[(2+x+3*x^2-x^3+5*x^4)*sqrt(3-x+2*x^2)/(5+2*x)^6,x,9,-3667/2880*(3-x+2*x^2)^(3/2)/(5+2*x)^5+711961/829440*(3-x+2*x^2)^(3/2)/(5+2*x)^4-38732321/179159040*(3-x+2*x^2)^(3/2)/(5+2*x)^3-5/32*arcsinh((1-4*x)/sqrt(23))/sqrt(2)+12895597463/82556485632*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)-1/6879707136*(4583087983+3174439702*x)*sqrt(3-x+2*x^2)/(5+2*x)^2],
[(2+x+3*x^2-x^3+5*x^4)*sqrt(3-x+2*x^2)/(5+2*x)^7,x,7,-3667/3456*(3-x+2*x^2)^(3/2)/(5+2*x)^6+92239/138240*(3-x+2*x^2)^(3/2)/(5+2*x)^5-5703277/39813120*(3-x+2*x^2)^(3/2)/(5+2*x)^4+87677717/8599633920*(3-x+2*x^2)^(3/2)/(5+2*x)^3-26972675/3962711310336*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)-1172725/330225942528*(17-22*x)*sqrt(3-x+2*x^2)/(5+2*x)^2],
[(2+x+3*x^2-x^3+5*x^4)*sqrt(3-x+2*x^2)/(5+2*x)^8,x,8,-3667/4032*(3-x+2*x^2)^(3/2)/(5+2*x)^7+948341/1741824*(3-x+2*x^2)^(3/2)/(5+2*x)^6-1464037/13934592*(3-x+2*x^2)^(3/2)/(5+2*x)^5+19414831/4013162496*(3-x+2*x^2)^(3/2)/(5+2*x)^4+246159769/866843099136*(3-x+2*x^2)^(3/2)/(5+2*x)^3-289071245/285315214344192*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)-12568315/23776267862016*(17-22*x)*sqrt(3-x+2*x^2)/(5+2*x)^2],
[(5+2*x)*(3-x+2*x^2)^(3/2)*(2+x+3*x^2-x^3+5*x^4),x,8,-92727/131072*(1-4*x)*(3-x+2*x^2)^(3/2)+69415/32256*(5+2*x)^2*(3-x+2*x^2)^(5/2)-1121/2304*(5+2*x)^3*(3-x+2*x^2)^(5/2)+5/144*(5+2*x)^4*(3-x+2*x^2)^(5/2)-3/143360*(661397+215900*x)*(3-x+2*x^2)^(5/2)-147157749/4194304*arcsinh((1-4*x)/sqrt(23))/sqrt(2)-6398163/2097152*(1-4*x)*sqrt(3-x+2*x^2)],
[(3-x+2*x^2)^(3/2)*(2+x+3*x^2-x^3+5*x^4),x,8,-8597/65536*(1-4*x)*(3-x+2*x^2)^(3/2)+1167/14336*(3-x+2*x^2)^(5/2)+125/3584*x*(3-x+2*x^2)^(5/2)+23/448*x^2*(3-x+2*x^2)^(5/2)+5/16*x^3*(3-x+2*x^2)^(5/2)-13643439/2097152*arcsinh((1-4*x)/sqrt(23))/sqrt(2)-593193/1048576*(1-4*x)*sqrt(3-x+2*x^2)],
[(3-x+2*x^2)^(3/2)*(2+x+3*x^2-x^3+5*x^4)/(5+2*x),x,10,1/12288*(500141-123060*x)*(3-x+2*x^2)^(3/2)+3505/896*(3-x+2*x^2)^(5/2)-311/448*(5+2*x)*(3-x+2*x^2)^(5/2)+5/112*(5+2*x)^2*(3-x+2*x^2)^(5/2)+1622009981/131072*arcsinh((1-4*x)/sqrt(23))/sqrt(2)-99009/8*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+1/65536*(141051019-23482924*x)*sqrt(3-x+2*x^2)],
[(3-x+2*x^2)^(3/2)*(2+x+3*x^2-x^3+5*x^4)/(5+2*x)^2,x,10,-1/18432*(909513-226052*x)*(3-x+2*x^2)^(3/2)-839/960*(3-x+2*x^2)^(5/2)-3667/576*(3-x+2*x^2)^(5/2)/(5+2*x)+5/96*(5+2*x)*(3-x+2*x^2)^(5/2)-982669459/65536*arcsinh((1-4*x)/sqrt(23))/sqrt(2)+959625/64*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)-1/32768*(85448933-14243732*x)*sqrt(3-x+2*x^2)],
[(3-x+2*x^2)^(3/2)*(2+x+3*x^2-x^3+5*x^4)/(5+2*x)^3,x,10,1/82944*(2154633-534617*x)*(3-x+2*x^2)^(3/2)+1/16*(3-x+2*x^2)^(5/2)-3667/1152*(3-x+2*x^2)^(5/2)/(5+2*x)^2+438065/82944*(3-x+2*x^2)^(5/2)/(5+2*x)+129342063/16384*arcsinh((1-4*x)/sqrt(23))/sqrt(2)-8083915/1024*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+1/24576*(33741483-5623292*x)*sqrt(3-x+2*x^2)],
[(3-x+2*x^2)^(3/2)*(2+x+3*x^2-x^3+5*x^4)/(5+2*x)^4,x,10,-1/17915904*(138006843-34265045*x)*(3-x+2*x^2)^(3/2)-3667/1728*(3-x+2*x^2)^(5/2)/(5+2*x)^3+556255/248832*(3-x+2*x^2)^(5/2)/(5+2*x)^2-32865365/17915904*(3-x+2*x^2)^(5/2)/(5+2*x)-19176431/8192*arcsinh((1-4*x)/sqrt(23))/sqrt(2)+517762327/221184*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)-1/331776*(135068604-22512089*x)*sqrt(3-x+2*x^2)],
[(3-x+2*x^2)^(3/2)*(2+x+3*x^2-x^3+5*x^4)/(5+2*x)^5,x,10,1/95551488*(762984903+67865260*x)*(3-x+2*x^2)^(3/2)/(5+2*x)-3667/2304*(3-x+2*x^2)^(5/2)/(5+2*x)^4+224815/165888*(3-x+2*x^2)^(5/2)/(5+2*x)^3-14477995/23887872*(3-x+2*x^2)^(5/2)/(5+2*x)^2+432565/1024*arcsinh((1-4*x)/sqrt(23))/sqrt(2)-8969688643/21233664*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+1/31850496*(2339916063-389975609*x)*sqrt(3-x+2*x^2)],
[(3-x+2*x^2)^(3/2)*(2+x+3*x^2-x^3+5*x^4)/(5+2*x)^6,x,10,1/95551488*(246012435+44773976*x)*(3-x+2*x^2)^(3/2)/(5+2*x)^2-3667/2880*(3-x+2*x^2)^(5/2)/(5+2*x)^5+158527/165888*(3-x+2*x^2)^(5/2)/(5+2*x)^4-3730507/11943936*(3-x+2*x^2)^(5/2)/(5+2*x)^3-23775/512*arcsinh((1-4*x)/sqrt(23))/sqrt(2)+70991525167/1528823808*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)-1/127401984*(5658774871+1028823716*x)*sqrt(3-x+2*x^2)/(5+2*x)],
[(3-x+2*x^2)^(3/2)*(2+x+3*x^2-x^3+5*x^4)/(5+2*x)^7,x,10,-1/13759414272*(9802984711+6793718806*x)*(3-x+2*x^2)^(3/2)/(5+2*x)^3-3667/3456*(3-x+2*x^2)^(5/2)/(5+2*x)^6+182165/248832*(3-x+2*x^2)^(5/2)/(5+2*x)^5-14087245/71663616*(3-x+2*x^2)^(5/2)/(5+2*x)^4+369/128*arcsinh((1-4*x)/sqrt(23))/sqrt(2)-1903976002333/660451885056*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+1/55037657088*(151764102421+27596573612*x)*sqrt(3-x+2*x^2)/(5+2*x)],
[(3-x+2*x^2)^(3/2)*(2+x+3*x^2-x^3+5*x^4)/(5+2*x)^8,x,10,-1/2293235712*(463558457+411822458*x)*(3-x+2*x^2)^(3/2)/(5+2*x)^4-3667/4032*(3-x+2*x^2)^(5/2)/(5+2*x)^7+114335/193536*(3-x+2*x^2)^(5/2)/(5+2*x)^6-1930441/13934592*(3-x+2*x^2)^(5/2)/(5+2*x)^5-5/64*arcsinh((1-4*x)/sqrt(23))/sqrt(2)+412760561351/5283615080448*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)-1/440301256704*(146583836191+101679102454*x)*sqrt(3-x+2*x^2)/(5+2*x)^2],

# p<0
[(5+2*x)*(2+x+3*x^2-x^3+5*x^4)/sqrt(3-x+2*x^2),x,6,-85429/4096*arcsinh((1-4*x)/sqrt(23))/sqrt(2)+761/256*(5+2*x)^2*sqrt(3-x+2*x^2)-105/128*(5+2*x)^3*sqrt(3-x+2*x^2)+1/16*(5+2*x)^4*sqrt(3-x+2*x^2)-1/2048*(19227+4676*x)*sqrt(3-x+2*x^2)],
[(2+x+3*x^2-x^3+5*x^4)/sqrt(3-x+2*x^2),x,6,-6863/2048*arcsinh((1-4*x)/sqrt(23))/sqrt(2)-505/1024*sqrt(3-x+2*x^2)-409/768*x*sqrt(3-x+2*x^2)+19/96*x^2*sqrt(3-x+2*x^2)+5/8*x^3*sqrt(3-x+2*x^2)],
[(2+x+3*x^2-x^3+5*x^4)/((5+2*x)*sqrt(3-x+2*x^2)),x,8,9657/256*arcsinh((1-4*x)/sqrt(23))/sqrt(2)-3667/96*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+1669/128*sqrt(3-x+2*x^2)-337/192*(5+2*x)*sqrt(3-x+2*x^2)+5/48*(5+2*x)^2*sqrt(3-x+2*x^2)],
[(2+x+3*x^2-x^3+5*x^4)/((5+2*x)^2*sqrt(3-x+2*x^2)),x,8,-2943/128*arcsinh((1-4*x)/sqrt(23))/sqrt(2)+158527/6912*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)-243/64*sqrt(3-x+2*x^2)-3667/576*sqrt(3-x+2*x^2)/(5+2*x)+5/32*(5+2*x)*sqrt(3-x+2*x^2)],
[(2+x+3*x^2-x^3+5*x^4)/((5+2*x)^3*sqrt(3-x+2*x^2)),x,8,149/32*arcsinh((1-4*x)/sqrt(23))/sqrt(2)-1546507/331776*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+5/16*sqrt(3-x+2*x^2)-3667/1152*sqrt(3-x+2*x^2)/(5+2*x)^2+92239/27648*sqrt(3-x+2*x^2)/(5+2*x)],
[(2+x+3*x^2-x^3+5*x^4)/((5+2*x)^4*sqrt(3-x+2*x^2)),x,8,-5/16*arcsinh((1-4*x)/sqrt(23))/sqrt(2)+22389491/71663616*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)-3667/1728*sqrt(3-x+2*x^2)/(5+2*x)^3+394907/248832*sqrt(3-x+2*x^2)/(5+2*x)^2-3163415/5971968*sqrt(3-x+2*x^2)/(5+2*x)],
[(2+x+3*x^2-x^3+5*x^4)/((5+2*x)^5*sqrt(3-x+2*x^2)),x,6,2053207/20639121408*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)-3667/2304*sqrt(3-x+2*x^2)/(5+2*x)^4+513097/497664*sqrt(3-x+2*x^2)/(5+2*x)^3-16295969/71663616*sqrt(3-x+2*x^2)/(5+2*x)^2+26800085/1719926784*sqrt(3-x+2*x^2)/(5+2*x)],
[(5+2*x)^2*(2+x+3*x^2-x^3+5*x^4)/(3-x+2*x^2)^(3/2),x,7,144217/1024*arcsinh((1-4*x)/sqrt(23))/sqrt(2)-4/23*(346-533*x)/sqrt(3-x+2*x^2)-13153/512*sqrt(3-x+2*x^2)+2645/128*x*sqrt(3-x+2*x^2)+153/16*x^2*sqrt(3-x+2*x^2)+5/4*x^3*sqrt(3-x+2*x^2)],
[(5+2*x)*(2+x+3*x^2-x^3+5*x^4)/(3-x+2*x^2)^(3/2),x,6,3111/128*arcsinh((1-4*x)/sqrt(23))/sqrt(2)+1/23*(-53+373*x)/sqrt(3-x+2*x^2)+33/64*sqrt(3-x+2*x^2)+193/48*x*sqrt(3-x+2*x^2)+5/6*x^2*sqrt(3-x+2*x^2)],
[(2+x+3*x^2-x^3+5*x^4)/(3-x+2*x^2)^(3/2),x,5,213/64*arcsinh((1-4*x)/sqrt(23))/sqrt(2)+1/92*(89+219*x)/sqrt(3-x+2*x^2)+27/32*sqrt(3-x+2*x^2)+5/8*x*sqrt(3-x+2*x^2)],
[(2+x+3*x^2-x^3+5*x^4)/((5+2*x)*(3-x+2*x^2)^(3/2)),x,7,39/16*arcsinh((1-4*x)/sqrt(23))/sqrt(2)-3667/1728*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+1/3312*(1191+917*x)/sqrt(3-x+2*x^2)+5/8*sqrt(3-x+2*x^2)],
[(2+x+3*x^2-x^3+5*x^4)/((5+2*x)^2*(3-x+2*x^2)^(3/2)),x,7,-5/8*arcsinh((1-4*x)/sqrt(23))/sqrt(2)+25951/41472*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+1/119232*(9897+2203*x)/sqrt(3-x+2*x^2)-3667/10368*sqrt(3-x+2*x^2)/(5+2*x)],
[(2+x+3*x^2-x^3+5*x^4)/((5+2*x)^3*(3-x+2*x^2)^(3/2)),x,5,-52631/5971968*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+1/4292352*(65991-8779*x)/sqrt(3-x+2*x^2)-3667/20736*sqrt(3-x+2*x^2)/(5+2*x)^2+115369/1492992*sqrt(3-x+2*x^2)/(5+2*x)],
[(2+x+3*x^2-x^3+5*x^4)/((5+2*x)^4*(3-x+2*x^2)^(3/2)),x,6,-3505819/1289945088*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+1/154524672*(369609-175877*x)/sqrt(3-x+2*x^2)-3667/31104*sqrt(3-x+2*x^2)/(5+2*x)^3+152885/4478976*sqrt(3-x+2*x^2)/(5+2*x)^2+430799/107495424*sqrt(3-x+2*x^2)/(5+2*x)],
[(5+2*x)^2*(2+x+3*x^2-x^3+5*x^4)/(3-x+2*x^2)^(5/2),x,6,-4/69*(346-533*x)/(3-x+2*x^2)^(3/2)-1471/32*arcsinh((1-4*x)/sqrt(23))/sqrt(2)+4/1587*(18982-20383*x)/sqrt(3-x+2*x^2)+247/16*sqrt(3-x+2*x^2)+5/4*x*sqrt(3-x+2*x^2)],
[(5+2*x)*(2+x+3*x^2-x^3+5*x^4)/(3-x+2*x^2)^(5/2),x,5,1/69*(-53+373*x)/(3-x+2*x^2)^(3/2)-71/8*arcsinh((1-4*x)/sqrt(23))/sqrt(2)+1/3174*(6055-28981*x)/sqrt(3-x+2*x^2)+5/4*sqrt(3-x+2*x^2)],
[(2+x+3*x^2-x^3+5*x^4)/(3-x+2*x^2)^(5/2),x,5,1/276*(89+219*x)/(3-x+2*x^2)^(3/2)-5/4*arcsinh((1-4*x)/sqrt(23))/sqrt(2)+1/2116*(-1465-2604*x)/sqrt(3-x+2*x^2)],
[(2+x+3*x^2-x^3+5*x^4)/((5+2*x)*(3-x+2*x^2)^(5/2)),x,5,1/9936*(1191+917*x)/(3-x+2*x^2)^(3/2)-3667/31104*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+1/1371168*(-335337-146729*x)/sqrt(3-x+2*x^2)],
[(2+x+3*x^2-x^3+5*x^4)/((5+2*x)^2*(3-x+2*x^2)^(5/2)),x,5,1/357696*(9897+2203*x)/(3-x+2*x^2)^(3/2)-2821/2239488*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+1/24681024*(-1255878+62021*x)/sqrt(3-x+2*x^2)-3667/186624*sqrt(3-x+2*x^2)/(5+2*x)],
[(2+x+3*x^2-x^3+5*x^4)/((5+2*x)^3*(3-x+2*x^2)^(5/2)),x,6,1/12877056*(65991-8779*x)/(3-x+2*x^2)^(3/2)+774079/322486272*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+1/592344576*(-4679797+2148263*x)/sqrt(3-x+2*x^2)-3667/373248*sqrt(3-x+2*x^2)/(5+2*x)^2-45979/26873856*sqrt(3-x+2*x^2)/(5+2*x)],
[(2+x+3*x^2-x^3+5*x^4)/((5+2*x)^4*(3-x+2*x^2)^(5/2)),x,7,1/463574016*(369609-175877*x)/(3-x+2*x^2)^(3/2)+4778789/7739670528*arctanh(1/12*(17-22*x)/(sqrt(2)*sqrt(3-x+2*x^2)))/sqrt(2)+1/31986607104*(-27754539+31190998*x)/sqrt(3-x+2*x^2)-3667/559872*sqrt(3-x+2*x^2)/(5+2*x)^3-89137/80621568*sqrt(3-x+2*x^2)/(5+2*x)^2+475357/1934917632*sqrt(3-x+2*x^2)/(5+2*x)],

#  Note: Tests the case when q+2*p+1==0. 
[(f+g*x+h*x^2+i*x^3+j*x^4)/(a+b*x+c*x^2)^(5/2),x,5,2/3*(a*b^2*c*i+2*a*c^2*(c*g-a*i)-a*b^3*j-b*c*(c^2*f+a*c*h-3*a^2*j)-(2*c^4*f-c^3*(b*g+2*a*h)+b^4*j-b^2*c*(b*i+4*a*j)+c^2*(b^2*h+3*a*b*i+2*a^2*j))*x)/(c^3*(b^2-4*a*c)*(a+b*x+c*x^2)^(3/2))+j*arctanh(1/2*(b+2*c*x)/(sqrt(c)*sqrt(a+b*x+c*x^2)))/c^(5/2)-2/3*(b^4*c*i+24*a^2*c^3*i+2*b^2*c^2*(2*c*g-3*a*i)-b^5*j-b^3*c*(c*h-10*a*j)-4*b*c^2*(2*c^2*f+a*c*h+8*a^2*j)-c*(16*c^4*f-c^3*(8*b*g-8*a*h)-4*b^4*j+b^2*c*(b*i+28*a*j)+2*c^2*(b^2*h-6*a*b*i-16*a^2*j))*x)/(c^3*(b^2-4*a*c)^2*sqrt(a+b*x+c*x^2))],
[(f+g*x+h*x^2+i*x^3+j*x^4)/(a+b*x-c*x^2)^(5/2),x,5,2/3*(a*b^2*c*i+2*a*c^2*(c*g+a*i)+a*b^3*j-b*c*(c^2*f-a*c*h-3*a^2*j)+(2*c^4*f+c^3*(b*g+2*a*h)+b^4*j+b^2*c*(b*i+4*a*j)+c^2*(b^2*h+3*a*b*i+2*a^2*j))*x)/(c^3*(b^2+4*a*c)*(a+b*x-c*x^2)^(3/2))-j*arctan(1/2*(b-2*c*x)/(sqrt(c)*sqrt(a+b*x-c*x^2)))/c^(5/2)-2/3*(b^4*c*i+24*a^2*c^3*i+2*b^2*c^2*(2*c*g+3*a*i)+b^5*j+b^3*c*(c*h+10*a*j)+4*b*c^2*(2*c^2*f-a*c*h+8*a^2*j)-c*(16*c^4*f+8*c^3*(b*g-a*h)-4*b^4*j-b^2*c*(b*i+28*a*j)+2*c^2*(b^2*h-6*a*b*i-16*a^2*j))*x)/(c^3*(b^2+4*a*c)^2*sqrt(a+b*x-c*x^2))],

# Integrands of the form P4[x] (d+e x)^m (a+b x+c x^2)^p with m symbolic
[(d+e*x)^m*(3+2*x+5*x^2)^3*(2+x+3*x^2-5*x^3+4*x^4),x,2,(5*d^2-2*d*e+3*e^2)^3*(4*d^4+5*d^3*e+3*d^2*e^2-d*e^3+2*e^4)*(d+e*x)^(1+m)/(e^11*(1+m))-(5*d^2-2*d*e+3*e^2)^2*(200*d^5+169*d^4*e+108*d^3*e^2-20*d^2*e^3+86*d*e^4-15*e^5)*(d+e*x)^(2+m)/(e^11*(2+m))+3*(5*d^2-2*d*e+3*e^2)*(1500*d^6+660*d^5*e+792*d^4*e^2+58*d^3*e^3+547*d^2*e^4-156*d*e^5+53*e^6)*(d+e*x)^(3+m)/(e^11*(3+m))-2*(30000*d^7+1050*d^6*e+21420*d^5*e^2+1715*d^4*e^3+9990*d^3*e^4-2550*d^2*e^5+2218*d*e^6-287*e^7)*(d+e*x)^(4+m)/(e^11*(4+m))+(105000*d^6+3150*d^5*e+53550*d^4*e^2+3430*d^3*e^3+14985*d^2*e^4-2550*d*e^5+1109*e^6)*(d+e*x)^(5+m)/(e^11*(5+m))-6*(21000*d^5+525*d^4*e+7140*d^3*e^2+343*d^2*e^3+999*d*e^4-85*e^5)*(d+e*x)^(6+m)/(e^11*(6+m))+(105000*d^4+2100*d^3*e+21420*d^2*e^2+686*d*e^3+999*e^4)*(d+e*x)^(7+m)/(e^11*(7+m))-2*(30000*d^3+450*d^2*e+3060*d*e^2+49*e^3)*(d+e*x)^(8+m)/(e^11*(8+m))+45*(500*d^2+5*d*e+17*e^2)*(d+e*x)^(9+m)/(e^11*(9+m))-25*(200*d+e)*(d+e*x)^(10+m)/(e^11*(10+m))+500*(d+e*x)^(11+m)/(e^11*(11+m))],
[(d+e*x)^m*(3+2*x+5*x^2)^2*(2+x+3*x^2-5*x^3+4*x^4),x,2,(5*d^2-2*d*e+3*e^2)^2*(4*d^4+5*d^3*e+3*d^2*e^2-d*e^3+2*e^4)*(d+e*x)^(1+m)/(e^9*(1+m))-(5*d^2-2*d*e+3*e^2)*(160*d^5+127*d^4*e+88*d^3*e^2-4*d^2*e^3+64*d*e^4-11*e^5)*(d+e*x)^(2+m)/(e^9*(2+m))+(2800*d^6+945*d^5*e+1665*d^4*e^2+370*d^3*e^3+888*d^2*e^4-195*d*e^5+107*e^6)*(d+e*x)^(3+m)/(e^9*(3+m))-(5600*d^5+1575*d^4*e+2220*d^3*e^2+370*d^2*e^3+592*d*e^4-65*e^5)*(d+e*x)^(4+m)/(e^9*(4+m))+(7000*d^4+1575*d^3*e+1665*d^2*e^2+185*d*e^3+148*e^4)*(d+e*x)^(5+m)/(e^9*(5+m))-(5600*d^3+945*d^2*e+666*d*e^2+37*e^3)*(d+e*x)^(6+m)/(e^9*(6+m))+(2800*d^2+315*d*e+111*e^2)*(d+e*x)^(7+m)/(e^9*(7+m))-5*(160*d+9*e)*(d+e*x)^(8+m)/(e^9*(8+m))+100*(d+e*x)^(9+m)/(e^9*(9+m))],
[(d+e*x)^m*(3+2*x+5*x^2)*(2+x+3*x^2-5*x^3+4*x^4),x,2,(5*d^2-2*d*e+3*e^2)*(4*d^4+5*d^3*e+3*d^2*e^2-d*e^3+2*e^4)*(d+e*x)^(1+m)/(e^7*(1+m))-(120*d^5+85*d^4*e+68*d^3*e^2+12*d^2*e^3+42*d*e^4-7*e^5)*(d+e*x)^(2+m)/(e^7*(2+m))+(300*d^4+170*d^3*e+102*d^2*e^2+12*d*e^3+21*e^4)*(d+e*x)^(3+m)/(e^7*(3+m))-2*(200*d^3+85*d^2*e+34*d*e^2+2*e^3)*(d+e*x)^(4+m)/(e^7*(4+m))+(300*d^2+85*d*e+17*e^2)*(d+e*x)^(5+m)/(e^7*(5+m))-(120*d+17*e)*(d+e*x)^(6+m)/(e^7*(6+m))+20*(d+e*x)^(7+m)/(e^7*(7+m))],
[(d+e*x)^m*(2+x+3*x^2-5*x^3+4*x^4)/(3+2*x+5*x^2),x,4,1/125*(100*d^2+165*d*e+81*e^2)*(d+e*x)^(1+m)/(e^3*(1+m))-1/25*(40*d+33*e)*(d+e*x)^(2+m)/(e^3*(2+m))+4/5*(d+e*x)^(3+m)/(e^3*(3+m))-1/3500*(d+e*x)^(1+m)*hypergeom([1,1+m],[2+m],5*(d+e*x)/(5*d-e*(1+I*sqrt(14))))*(6412*I+423*sqrt(14))/((1+m)*(5*I*d-e*(I-sqrt(14))))-1/3500*(d+e*x)^(1+m)*hypergeom([1,1+m],[2+m],5*(d+e*x)/(5*d-e+I*e*sqrt(14)))*(6412*I-423*sqrt(14))/((1+m)*(5*I*d-e*(I+sqrt(14))))],
[(d+e*x)^m*(2+x+3*x^2-5*x^3+4*x^4)/(3+2*x+5*x^2)^2,x,5,4/25*(d+e*x)^(1+m)/(e*(1+m))-1/700*(1367*d-293*e+(423*d-1367*e)*x)*(d+e*x)^(1+m)/((5*d^2-2*d*e+3*e^2)*(3+2*x+5*x^2))+1/19600*(d+e*x)^(1+m)*hypergeom([1,1+m],[2+m],5*(d+e*x)/(5*d-e*(1+I*sqrt(14))))*(80360*d^2-32144*d*e+48216*e^2-5922*d*e*m+19138*e^2*m-I*(6565*d^2-2*d*e*(1313-3206*m)+e^2*(3939-98*m))*sqrt(14))/((5*d^2-2*d*e+3*e^2)*(1+m)*(5*d-e*(1+I*sqrt(14))))+1/19600*(d+e*x)^(1+m)*hypergeom([1,1+m],[2+m],5*(d+e*x)/(5*d-e+I*e*sqrt(14)))*(80360*d^2-32144*d*e+48216*e^2-5922*d*e*m+19138*e^2*m+I*(6565*d^2-2*d*e*(1313-3206*m)+e^2*(3939-98*m))*sqrt(14))/((5*d^2-2*d*e+3*e^2)*(1+m)*(5*d+I*e*(I+sqrt(14))))],

# Integrands of the form Pq[x] (d+e x)^m (a+b x+c x^2)^p

# Integrands of the form Pq[x] (d+e x)^m (a+b x+c x^2)^p

# Integrands of the form x^m Pq[x] (a+b x+c x^2)^p

# p>0

# p<0

#  Note: Tests the case when q+2*p+1==0. 
[(d+e*x+f*x^2+g*x^3+h*x^4+i*x^5)/(a+b*x+c*x^2)^3,x,6,1/2*(-a*b^3*c*h-b*c^2*(c^2*d+a*c*f-3*a^2*h)+a*b^4*i+a*b^2*c*(c*g-4*a*i)+2*a*c^2*(c^2*e-a*c*g+a^2*i)-(2*c^5*d-c^4*(b*e+2*a*f)+c^3*(b^2*f+3*a*b*g+2*a^2*h)-b^5*i+b^3*c*(b*h+5*a*i)-b*c^2*(b^2*g+4*a*b*h+5*a^2*i))*x)/(c^4*(b^2-4*a*c)*(a+b*x+c*x^2)^2)+1/2*(b^5*c*h+b^3*c^2*(c*f-8*a*h)+2*b*c^3*(3*c^2*d+a*c*f+11*a^2*h)-b^6*i-b^4*c*(c*g-11*a*i)-16*a^2*c^3*(c*g-2*a*i)-b^2*c^2*(3*c^2*e-5*a*c*g+39*a^2*i)+2*c*(6*c^5*d-c^4*(3*b*e-2*a*f)+c^3*(b^2*f-3*a*b*g-10*a^2*h)+2*b^5*i-b^3*c*(b*h+15*a*i)+a*b*c^2*(8*b*h+25*a*i))*x)/(c^4*(b^2-4*a*c)^2*(a+b*x+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(b*l+8*a*m)+b^4*c^2*(b^2*k+7*a*b*l+20*a^2*m)-b^2*c^3*(b^3*j+6*a*b^2*k+14*a^2*b*l+16*a^3*m)+c^4*(b^4*h+5*a*b^3*j+9*a^2*b^2*k+7*a^3*b*l+2*a^4*m))*arctanh((b+2*c*x)/sqrt(b^2-4*a*c))/(c^8*sqrt(b^2-4*a*c))],

# Integrands of the form x^m Pq[x] (a+b x+c x^2)^(p/2)

# Integrands of the form Pq[x] (d+e x+f x^2)^m (a+b x+c x^2)^p

# Integrands of the form Pq[x] (d+e x+f x^2)^m (a+b x+c x^2)^p

# Integrands of the form (d+e x+f x^2)^m Pq[x] (a+b x+c x^2)^(p/2)

# p>0
[(1+4*x-7*x^2)^3*(2+5*x+x^2)*sqrt(3+2*x+5*x^2),x,11,-1968340667/131250000*(3+2*x+5*x^2)^(3/2)+1045360143/43750000*x*(3+2*x+5*x^2)^(3/2)+98060877/4375000*x^2*(3+2*x+5*x^2)^(3/2)-90960857/1575000*x^3*(3+2*x+5*x^2)^(3/2)-888751/105000*x^4*(3+2*x+5*x^2)^(3/2)+190939/3000*x^5*(3+2*x+5*x^2)^(3/2)-50519/2250*x^6*(3+2*x+5*x^2)^(3/2)-343/50*x^7*(3+2*x+5*x^2)^(3/2)-540119881/15625000*arcsinh((1+5*x)/sqrt(14))/sqrt(5)-77159983/31250000*(1+5*x)*sqrt(3+2*x+5*x^2)],
[(1+4*x-7*x^2)^2*(2+5*x+x^2)*sqrt(3+2*x+5*x^2),x,9,198439/750000*(3+2*x+5*x^2)^(3/2)+1781669/250000*x*(3+2*x+5*x^2)^(3/2)-77509/25000*x^2*(3+2*x+5*x^2)^(3/2)-25277/3000*x^3*(3+2*x+5*x^2)^(3/2)+989/200*x^4*(3+2*x+5*x^2)^(3/2)+49/40*x^5*(3+2*x+5*x^2)^(3/2)-17652061/625000*arcsinh((1+5*x)/sqrt(14))/sqrt(5)-2521723/1250000*(1+5*x)*sqrt(3+2*x+5*x^2)],
[(1+4*x-7*x^2)*(2+5*x+x^2)*sqrt(3+2*x+5*x^2),x,7,7819/7500*(3+2*x+5*x^2)^(3/2)+2149/2500*x*(3+2*x+5*x^2)^(3/2)-289/250*x^2*(3+2*x+5*x^2)^(3/2)-7/30*x^3*(3+2*x+5*x^2)^(3/2)-32431/6250*arcsinh((1+5*x)/sqrt(14))/sqrt(5)-4633/12500*(1+5*x)*sqrt(3+2*x+5*x^2)],
[(2+5*x+x^2)*sqrt(3+2*x+5*x^2)/(1+4*x-7*x^2),x,9,-8233/1715*arcsinh((1+5*x)/sqrt(14))/sqrt(5)-1/490*(397+35*x)*sqrt(3+2*x+5*x^2)-3/343*arctanh((23+x*(17-5*sqrt(11))-sqrt(11))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125-17*sqrt(11)))))*sqrt(1/11*(497041-146555*sqrt(11)))+3/343*arctanh((23+sqrt(11)+x*(17+5*sqrt(11)))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125+17*sqrt(11)))))*sqrt(1/11*(497041+146555*sqrt(11)))],
[(2+5*x+x^2)*sqrt(3+2*x+5*x^2)/(1+4*x-7*x^2)^2,x,9,1/49*arcsinh((1+5*x)/sqrt(14))*sqrt(5)+3/154*(3+61*x)*sqrt(3+2*x+5*x^2)/(1+4*x-7*x^2)+1/2156*arctanh((23+sqrt(11)+x*(17+5*sqrt(11)))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125+17*sqrt(11)))))*sqrt(1/1397*(325022311-39132731*sqrt(11)))-1/2156*arctanh((23+x*(17-5*sqrt(11))-sqrt(11))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125-17*sqrt(11)))))*sqrt(1/1397*(325022311+39132731*sqrt(11)))],
[(2+5*x+x^2)*sqrt(3+2*x+5*x^2)/(1+4*x-7*x^2)^3,x,7,3/308*(3+61*x)*sqrt(3+2*x+5*x^2)/(1+4*x-7*x^2)^2-1/1721104*(272941-813113*x)*sqrt(3+2*x+5*x^2)/(1+4*x-7*x^2)-1/491744*arctanh((23+x*(17-5*sqrt(11))-sqrt(11))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125-17*sqrt(11)))))*sqrt(1/1397*(6492253020949-11879169071*sqrt(11)))+1/491744*arctanh((23+sqrt(11)+x*(17+5*sqrt(11)))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125+17*sqrt(11)))))*sqrt(1/1397*(6492253020949+11879169071*sqrt(11)))],
[(1+4*x-7*x^2)^3*(2+5*x+x^2)*(3+2*x+5*x^2)^(3/2),x,12,-22840599/62500000*(1+5*x)*(3+2*x+5*x^2)^(3/2)-6133820867/1203125000*(3+2*x+5*x^2)^(5/2)+837379699/72187500*x*(3+2*x+5*x^2)^(5/2)+2173004363/173250000*x^2*(3+2*x+5*x^2)^(5/2)-190236913/4950000*x^3*(3+2*x+5*x^2)^(5/2)-796559/123750*x^4*(3+2*x+5*x^2)^(5/2)+1031177/20625*x^5*(3+2*x+5*x^2)^(5/2)-61103/3300*x^6*(3+2*x+5*x^2)^(5/2)-343/60*x^7*(3+2*x+5*x^2)^(5/2)-3357568053/156250000*arcsinh((1+5*x)/sqrt(14))/sqrt(5)-479652579/312500000*(1+5*x)*sqrt(3+2*x+5*x^2)],
[(1+4*x-7*x^2)^2*(2+5*x+x^2)*(3+2*x+5*x^2)^(3/2),x,10,-690561/1250000*(1+5*x)*(3+2*x+5*x^2)^(3/2)+505667/2187500*(3+2*x+5*x^2)^(5/2)+86721/21875*x*(3+2*x+5*x^2)^(5/2)-219271/105000*x^2*(3+2*x+5*x^2)^(5/2)-18379/3000*x^3*(3+2*x+5*x^2)^(5/2)+581/150*x^4*(3+2*x+5*x^2)^(5/2)+49/50*x^5*(3+2*x+5*x^2)^(5/2)-101512467/3125000*arcsinh((1+5*x)/sqrt(14))/sqrt(5)-14501781/6250000*(1+5*x)*sqrt(3+2*x+5*x^2)],
[(1+4*x-7*x^2)*(2+5*x+x^2)*(3+2*x+5*x^2)^(3/2),x,8,-18397/150000*(1+5*x)*(3+2*x+5*x^2)^(3/2)+149509/262500*(3+2*x+5*x^2)^(5/2)+2809/5250*x*(3+2*x+5*x^2)^(5/2)-1163/1400*x^2*(3+2*x+5*x^2)^(5/2)-7/40*x^3*(3+2*x+5*x^2)^(5/2)-901453/125000*arcsinh((1+5*x)/sqrt(14))/sqrt(5)-128779/250000*(1+5*x)*sqrt(3+2*x+5*x^2)],
[(2+5*x+x^2)*(3+2*x+5*x^2)^(3/2)/(1+4*x-7*x^2),x,10,-1/980*(267+35*x)*(3+2*x+5*x^2)^(3/2)-34425687/840350*arcsinh((1+5*x)/sqrt(14))/sqrt(5)-3/240100*(571621+196105*x)*sqrt(3+2*x+5*x^2)-6/16807*arctanh((23+x*(17-5*sqrt(11))-sqrt(11))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125-17*sqrt(11)))))*sqrt(2/11*(8098902607-2434122235*sqrt(11)))+6/16807*arctanh((23+sqrt(11)+x*(17+5*sqrt(11)))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125+17*sqrt(11)))))*sqrt(2/11*(8098902607+2434122235*sqrt(11)))],
[(2+5*x+x^2)*(3+2*x+5*x^2)^(3/2)/(1+4*x-7*x^2)^2,x,10,3/154*(3+61*x)*(3+2*x+5*x^2)^(3/2)/(1+4*x-7*x^2)+16691/2401*arcsinh((1+5*x)/sqrt(14))/sqrt(5)+1/3773*(5826+3395*x)*sqrt(3+2*x+5*x^2)-1/26411*arctanh((23+x*(17-5*sqrt(11))-sqrt(11))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125-17*sqrt(11)))))*sqrt(1/22*(52175400311-13155376531*sqrt(11)))-1/26411*arctanh((23+sqrt(11)+x*(17+5*sqrt(11)))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125+17*sqrt(11)))))*sqrt(1/22*(52175400311+13155376531*sqrt(11)))],
[(2+5*x+x^2)*(3+2*x+5*x^2)^(3/2)/(1+4*x-7*x^2)^3,x,10,3/308*(3+61*x)*(3+2*x+5*x^2)^(3/2)/(1+4*x-7*x^2)^2-5/343*arcsinh((1+5*x)/sqrt(14))*sqrt(5)-1/23716*(9495-37088*x)*sqrt(3+2*x+5*x^2)/(1+4*x-7*x^2)-1/332024*arctanh((23+x*(17-5*sqrt(11))-sqrt(11))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125-17*sqrt(11)))))*sqrt(1/2794*(62294197250171-2085440742055*sqrt(11)))+1/332024*arctanh((23+sqrt(11)+x*(17+5*sqrt(11)))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125+17*sqrt(11)))))*sqrt(1/2794*(62294197250171+2085440742055*sqrt(11)))],

# p<0
[(1+4*x-7*x^2)^3*(2+5*x+x^2)/sqrt(3+2*x+5*x^2),x,10,-77513689/625000*arcsinh((1+5*x)/sqrt(14))/sqrt(5)-16515809/156250*sqrt(3+2*x+5*x^2)+5793077/75000*x*sqrt(3+2*x+5*x^2)+40722851/750000*x^2*sqrt(3+2*x+5*x^2)-5160533/50000*x^3*sqrt(3+2*x+5*x^2)-47807/3750*x^4*sqrt(3+2*x+5*x^2)+26159/300*x^5*sqrt(3+2*x+5*x^2)-1141/40*x^6*sqrt(3+2*x+5*x^2)-343/40*x^7*sqrt(3+2*x+5*x^2)],
[(1+4*x-7*x^2)^2*(2+5*x+x^2)/sqrt(3+2*x+5*x^2),x,8,-1719097/31250*arcsinh((1+5*x)/sqrt(14))/sqrt(5)-22053/31250*sqrt(3+2*x+5*x^2)+36073/1875*x*sqrt(3+2*x+5*x^2)-207427/37500*x^2*sqrt(3+2*x+5*x^2)-33259/2500*x^3*sqrt(3+2*x+5*x^2)+5131/750*x^4*sqrt(3+2*x+5*x^2)+49/30*x^5*sqrt(3+2*x+5*x^2)],
[(1+4*x-7*x^2)*(2+5*x+x^2)/sqrt(3+2*x+5*x^2),x,6,-1901/250*arcsinh((1+5*x)/sqrt(14))/sqrt(5)+463/125*sqrt(3+2*x+5*x^2)+59/30*x*sqrt(3+2*x+5*x^2)-571/300*x^2*sqrt(3+2*x+5*x^2)-7/20*x^3*sqrt(3+2*x+5*x^2)],
[(2+5*x+x^2)/((1+4*x-7*x^2)*sqrt(3+2*x+5*x^2)),x,8,-1/7*arcsinh((1+5*x)/sqrt(14))/sqrt(5)-3/14*arctanh((23+x*(17-5*sqrt(11))-sqrt(11))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125-17*sqrt(11)))))*sqrt(1/2794*(4091-1055*sqrt(11)))+3/14*arctanh((23+sqrt(11)+x*(17+5*sqrt(11)))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125+17*sqrt(11)))))*sqrt(1/2794*(4091+1055*sqrt(11)))],
[(2+5*x+x^2)/((1+4*x-7*x^2)^2*sqrt(3+2*x+5*x^2)),x,6,-3/5588*(40-371*x)*sqrt(3+2*x+5*x^2)/(1+4*x-7*x^2)+1/11176*arctanh((23+sqrt(11)+x*(17+5*sqrt(11)))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125+17*sqrt(11)))))*sqrt(1/2794*(3027900955-14035681*sqrt(11)))-1/11176*arctanh((23+x*(17-5*sqrt(11))-sqrt(11))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125-17*sqrt(11)))))*sqrt(1/2794*(3027900955+14035681*sqrt(11)))],
[(2+5*x+x^2)/((1+4*x-7*x^2)^3*sqrt(3+2*x+5*x^2)),x,7,-3/11176*(40-371*x)*sqrt(3+2*x+5*x^2)/(1+4*x-7*x^2)^2-7/62451488*(409769-1189370*x)*sqrt(3+2*x+5*x^2)/(1+4*x-7*x^2)-7/124902976*arctanh((23+x*(17-5*sqrt(11))-sqrt(11))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125-17*sqrt(11)))))*(39370231-2538725*sqrt(11))/sqrt(22*(125-17*sqrt(11)))+7/124902976*arctanh((23+sqrt(11)+x*(17+5*sqrt(11)))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125+17*sqrt(11)))))*(39370231+2538725*sqrt(11))/sqrt(22*(125+17*sqrt(11)))],
[(1+4*x-7*x^2)^3*(2+5*x+x^2)/(3+2*x+5*x^2)^(3/2),x,9,50047657/156250*arcsinh((1+5*x)/sqrt(14))/sqrt(5)+16/546875*(6122807-5338217*x)/sqrt(3+2*x+5*x^2)+15715799/156250*sqrt(3+2*x+5*x^2)-3192602/46875*x*sqrt(3+2*x+5*x^2)-2583293/187500*x^2*sqrt(3+2*x+5*x^2)+393659/12500*x^3*sqrt(3+2*x+5*x^2)-25921/3750*x^4*sqrt(3+2*x+5*x^2)-343/150*x^5*sqrt(3+2*x+5*x^2)],
[(1+4*x-7*x^2)^2*(2+5*x+x^2)/(3+2*x+5*x^2)^(3/2),x,7,89583/1250*arcsinh((1+5*x)/sqrt(14))/sqrt(5)-8/21875*(12983+136602*x)/sqrt(3+2*x+5*x^2)-5086/3125*sqrt(3+2*x+5*x^2)-8749/1250*x*sqrt(3+2*x+5*x^2)+203/100*x^2*sqrt(3+2*x+5*x^2)+49/100*x^3*sqrt(3+2*x+5*x^2)],
[(1+4*x-7*x^2)*(2+5*x+x^2)/(3+2*x+5*x^2)^(3/2),x,5,149/25*arcsinh((1+5*x)/sqrt(14))/sqrt(5)-2/875*(2321+2449*x)/sqrt(3+2*x+5*x^2)-261/250*sqrt(3+2*x+5*x^2)-7/50*x*sqrt(3+2*x+5*x^2)],
[(2+5*x+x^2)/((1+4*x-7*x^2)*(3+2*x+5*x^2)^(3/2)),x,6,1/3556*(-131+605*x)/sqrt(3+2*x+5*x^2)-3/1016*arctanh((23+x*(17-5*sqrt(11))-sqrt(11))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125-17*sqrt(11)))))*sqrt(1/1397*(281693-25015*sqrt(11)))+3/1016*arctanh((23+sqrt(11)+x*(17+5*sqrt(11)))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125+17*sqrt(11)))))*sqrt(1/1397*(281693+25015*sqrt(11)))],
[(2+5*x+x^2)/((1+4*x-7*x^2)^2*(3+2*x+5*x^2)^(3/2)),x,7,1/19870928*(-76567-22755*x)/sqrt(3+2*x+5*x^2)-3/5588*(40-371*x)/((1+4*x-7*x^2)*sqrt(3+2*x+5*x^2))-7/2838704*arctanh((23+x*(17-5*sqrt(11))-sqrt(11))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125-17*sqrt(11)))))*(541543-5144*sqrt(11))/sqrt(22*(125-17*sqrt(11)))+7/2838704*arctanh((23+sqrt(11)+x*(17+5*sqrt(11)))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125+17*sqrt(11)))))*(541543+5144*sqrt(11))/sqrt(22*(125+17*sqrt(11)))],
[(2+5*x+x^2)/((1+4*x-7*x^2)^3*(3+2*x+5*x^2)^(3/2)),x,8,-5/222077491328*(461370781+1118731375*x)/sqrt(3+2*x+5*x^2)-3/11176*(40-371*x)/((1+4*x-7*x^2)^2*sqrt(3+2*x+5*x^2))+1/62451488*(-2701733+9148874*x)/((1+4*x-7*x^2)*sqrt(3+2*x+5*x^2))-7/31725355904*arctanh((23+x*(17-5*sqrt(11))-sqrt(11))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125-17*sqrt(11)))))*(2792860024-84865895*sqrt(11))/sqrt(22*(125-17*sqrt(11)))+7/31725355904*arctanh((23+sqrt(11)+x*(17+5*sqrt(11)))/(sqrt(3+2*x+5*x^2)*sqrt(2*(125+17*sqrt(11)))))*(2792860024+84865895*sqrt(11))/sqrt(22*(125+17*sqrt(11)))],

# Integrands of the form (d+e x+f x^2)^m Pq[x] (a+b x+c x^2)^p with p and/or q symbolic
[(a+c*x^2)^p*(A+C*x^2)*(d+f*x^2)^q,x,7,A*x*(a+c*x^2)^p*(d+f*x^2)^q*AppellF1(1/2,-p,-q,3/2,-c*x^2/a,-f*x^2/d)/((1+c*x^2/a)^p*(1+f*x^2/d)^q)+1/3*C*x^3*(a+c*x^2)^p*(d+f*x^2)^q*AppellF1(3/2,-p,-q,5/2,-c*x^2/a,-f*x^2/d)/((1+c*x^2/a)^p*(1+f*x^2/d)^q)],
[(A+B*x)*(a+c*x^2)^p*(d+f*x^2)^q,x,7,A*x*(a+c*x^2)^p*(d+f*x^2)^q*AppellF1(1/2,-p,-q,3/2,-c*x^2/a,-f*x^2/d)/((1+c*x^2/a)^p*(1+f*x^2/d)^q)+1/2*B*(a+c*x^2)^(1+p)*(d+f*x^2)^q*hypergeom([1+p,-q],[2+p],-f*(a+c*x^2)/(c*d-a*f))/(c*(1+p)*(c*(d+f*x^2)/(c*d-a*f))^q)],
[(a+c*x^2)^p*(A+B*x+C*x^2)*(d+f*x^2)^q,x,11,A*x*(a+c*x^2)^p*(d+f*x^2)^q*AppellF1(1/2,-p,-q,3/2,-c*x^2/a,-f*x^2/d)/((1+c*x^2/a)^p*(1+f*x^2/d)^q)+1/3*C*x^3*(a+c*x^2)^p*(d+f*x^2)^q*AppellF1(3/2,-p,-q,5/2,-c*x^2/a,-f*x^2/d)/((1+c*x^2/a)^p*(1+f*x^2/d)^q)+1/2*B*(a+c*x^2)^(1+p)*(d+f*x^2)^q*hypergeom([1+p,-q],[2+p],-f*(a+c*x^2)/(c*d-a*f))/(c*(1+p)*(c*(d+f*x^2)/(c*d-a*f))^q)]]:
